Skip to content

Instantly share code, notes, and snippets.

@justinmeza
Created December 1, 2014 17:01
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save justinmeza/b31853453ed015ce48a0 to your computer and use it in GitHub Desktop.
Save justinmeza/b31853453ed015ce48a0 to your computer and use it in GitHub Desktop.
connecting to a remote TCP server in LOLCODE
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