azawawi / farabi6

Experimental in-browser Perl 6 Editor
Artistic License 2.0
14 stars 12 forks source link

Use IO::Socket::SSL #67

Open azawawi opened 9 years ago

azawawi commented 9 years ago

IO::Socket::SSL now works on linux and win32. We should use that for github operations

See https://github.com/sergot/io-socket-ssl/blob/master/test.p6

use v6;

# Display https://raw.githubusercontent.com/azawawi/farabi6/master/README.md
use IO::Socket::SSL;
my $ssl = IO::Socket::SSL.new(:host<raw.githubusercontent.com>, :port(443));
my $content;
$ssl.send("GET /azawawi/farabi6/master/README.md HTTP/1.1\r\nHost: raw.githubusercontent.com\r\n\r\n");
while my $read = $ssl.recv {
    $content ~= $read;
}
say $content;