Skip to content

Instantly share code, notes, and snippets.

@jcromartie
Created August 28, 2012 22:05
Show Gist options
  • Select an option

  • Save jcromartie/3504745 to your computer and use it in GitHub Desktop.

Select an option

Save jcromartie/3504745 to your computer and use it in GitHub Desktop.
# code:
# set up the webhook and wait for a connection
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
print "binding on host", webhook_host, "port", webhook_port
s.bind((webhook_host, webhook_port))
print "listening"
s.listen(1)
print "accepting connections"
conn, (addr, port) = s.accept()
# output like:
# binding on host level02-3.stripe-ctf.com port 9894
# listening
# accepting connections
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment