<commit_before>#!/usr/bin/env perl6

use v6;

=begin pod

=TITLE Writing a TCP Client

=AUTHOR stmuk

You want to connect to a socket on a remote host

=end pod

my $s = IO::Socket::INET.new( :host<www.perl6.org>, :port(80) );
$s.print( "HEAD / HTTP/1.0\r\n\r\n" );

while my $r = $s.get {<commit_msg>Add Host header to HTTP request<commit_after>#!/usr/bin/env perl6

use v6;

=begin pod

=TITLE Writing a TCP Client

=AUTHOR stmuk

You want to connect to a socket on a remote host

=end pod

my $s = IO::Socket::INET.new( :host<www.perl6.org>, :port(80) );
$s.print( "HEAD / HTTP/1.1\r\nHost: perl6.org\r\nHost: perl6.org\r\n\r\n" );

while my $r = $s.get {
{'fraction_non_alphanumeric': 0.16717325227963525, 'fraction_numerical': 0.0243161094224924, 'mean_word_length': 3.5136986301369864, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4662248', 'n_tokens_mistral': 298, 'n_tokens_neox': 289, 'n_words': 83}