Created
December 1, 2014 17:01
-
-
Save justinmeza/b31853453ed015ce48a0 to your computer and use it in GitHub Desktop.
connecting to a remote TCP server in LOLCODE
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
HAI 1.3 | |
CAN HAS SOCKS? | |
I HAS A local | |
local R I IZ SOCKS'Z BIND YR "ANY" AN YR 12345 MKAY | |
BTW get an IP address | |
I HAS A addr ITZ I IZ SOCKS'Z RESOLV YR "google.com" MKAY | |
BTW connect to a remote port | |
I HAS A remote | |
remote R I IZ SOCKS'Z KONN YR local AN YR addr AN YR 80 MKAY | |
BTW send some stuff | |
I IZ SOCKS'Z PUT YR local AN YR remote AN YR "GET http://www.google.com/:)" MKAY | |
BTW should be "HTTP/1.0 200 OK\n" | |
I HAS A data | |
data R I IZ SOCKS'Z GET YR local AN YR remote AN YR 16 MKAY | |
VISIBLE data | |
BTW cleanup or else program will be blocked waiting for port | |
I IZ SOCKS'Z CLOSE YR local MKAY | |
KTHXBYE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment