Created
March 28, 2011 08:52
-
-
Save moritz/890168 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cat server.pl | |
my $s = IO::Socket::INET.new(:localhost('::1'), :localport(1024), :listen); | |
say "Server running"; | |
while my $client = $s.accept { | |
print $client.recv(); | |
$client.close; | |
} | |
$ ./perl6 server.pl | |
Server running | |
# on another shell: | |
$ nmap -6 ::1 | |
Starting Nmap 5.00 ( http://nmap.org ) at 2011-03-28 10:49 CEST | |
Interesting ports on localhost (::1): | |
Not shown: 995 closed ports | |
PORT STATE SERVICE | |
22/tcp open ssh | |
25/tcp open smtp | |
80/tcp open http | |
631/tcp open ipp | |
5432/tcp open postgresql | |
Nmap done: 1 IP address (1 host up) scanned in 0.16 seconds |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment