Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^4: IO::Socket:SSL and Net::Server STDOUT redirection

by Zucan (Beadle)
on Nov 17, 2014 at 21:23 UTC ( [id://1107481]=note: print w/replies, xml ) Need Help??


in reply to Re^3: IO::Socket:SSL and Net::Server STDOUT redirection
in thread IO::Socket:SSL and Net::Server STDOUT redirection

Ah, that worked!

Here is the working example:
#!/usr/bin/perl -w use strict; use IO::Socket::SSL; my $port = 12345; my $server = IO::Socket::SSL->new( LocalAddr => '127.0.0.1', LocalPort => $port, Listen => 10, Reuse => 1, SSL_cert_file => 'cert.pem', SSL_key_file => 'key.pem', ) or die "failed to listen: $!"; my $client = $server->accept; *STDOUT = $client; print "The client should see this STDOUT message.\n"; print $client "The client should see this SOCKET message.\n"; close($client);
The output I now see is as follows:
$ nc --ssl localhost 12345 The client should see this STDOUT message. The client should see this SOCKET message.
Thank you!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1107481]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (2)
As of 2024-04-24 16:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found