Skip to content

Instantly share code, notes, and snippets.

@crtr0
Created January 10, 2013 00:47
Show Gist options
  • Select an option

  • Save crtr0/4498425 to your computer and use it in GitHub Desktop.

Select an option

Save crtr0/4498425 to your computer and use it in GitHub Desktop.
~/Code/scripts
ಠ_ಠ node -e 'require("http").createServer(function(q,s){console.error(q.headers);s.end("ok");this.close()}).listen(1337)' &
[1] 50947
~/Code/scripts
ಠ_ಠ cat foo.py #!/usr/bin/env python
import urllib
response = urllib.urlopen("http://localhost:1337")
print response
~/Code/scripts
ಠ_ಠ python foo.py
{ host: 'localhost:1337', 'user-agent': 'Python-urllib/1.17' }
<addinfourl at 4529424720 whose fp = <socket._fileobject object at 0x10dcaa4d0>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment