Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
Hello. I've tried your hints by doing the changes of Daemon.pm and use my script but not with desired success. Has anyone perhaps sample-code for proxying client-requests with CONNECT-method to establish ssl and what additional changes have to do? I'll be very glad, if someone can post it here. Best regards, Andreas
my $UA = LWP::UserAgent->new; $UA->agent("Mozilla/4.0"); $UA->protocols_allowed(['http','https']); my $SRV = HTTP::Daemon->new(LocalPort => 3128); while (my $conn = $SRV->accept) { while (my $request = $conn->get_request) { my $resp = $UA->simple_request($request); $conn->send_response($resp); } $conn->close; }
Debugoutput in request to local webserver and https://www.nodeworks.com looks like:
LWP::UserAgent::send_request: GET http://127.0.0.1/ LWP::UserAgent::_need_proxy: Not proxied LWP::UserAgent::send_request: http URLs are among LWP::UserAgent=HASH( +0x1fe594)'s allowed protocols (http https) LWP::Protocol::http::request: () LWP::Protocol::collect: read 639 bytes LWP::Protocol::collect: read 817 bytes LWP::UserAgent::send_request: GET http://127.0.0.1/apache_pb.gif LWP::UserAgent::_need_proxy: Not proxied LWP::UserAgent::send_request: http URLs are among LWP::UserAgent=HASH( +0x1fe594)'s allowed protocols (http https) LWP::Protocol::http::request: () LWP::UserAgent::send_request: CONNECT http://www.nodeworks.com:443 LWP::UserAgent::_need_proxy: Not proxied LWP::UserAgent::send_request: http URLs are among LWP::UserAgent=HASH( +0x1fe594)'s allowed protocols (http https) LWP::Protocol::http::request: () LWP::UserAgent::send_request: CONNECT http://www.nodeworks.com:443 LWP::UserAgent::_need_proxy: Not proxied LWP::UserAgent::send_request: http URLs are among LWP::UserAgent=HASH( +0x1fe594)'s allowed protocols (http https) LWP::Protocol::http::request: ()

In reply to Re: Re: HTTP::Daemon and SSL by niemeand
in thread HTTP::Daemon and SSL by steves

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2022-05-17 10:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (65 votes). Check out past polls.

    Notices?