Skip to content

Instantly share code, notes, and snippets.

@0racle
Last active October 28, 2019 04:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 0racle/09137d1a904d12ed3aaaa26037c35ace to your computer and use it in GitHub Desktop.
Save 0racle/09137d1a904d12ed3aaaa26037c35ace to your computer and use it in GitHub Desktop.
IO::Socket::SSL
use IO::Socket::SSL;
my $ssl = IO::Socket::SSL.new(:host<google.com>, :port(443));
$ssl.print(qq:to<END>);
GET / HTTP/1.1
Host:www.google.com
Connection:close
END
while $ssl.read(65535) -> $chunk {
print $chunk.decode('UTF8-C8');
}
$ssl.close;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment