Skip to content

Instantly share code, notes, and snippets.

@Rajdeep-Das
Created May 4, 2019 20:39
Simple Socket program in python
from socket import *
s = socket(AF_INET,SOCK_STREAM)
s.connect(("127.0.0.1",8888)) # Connect
s.send("GET /index.html HTTP/1.0\n\n") # Send request
data = s.recv(10000) # Get response
print (data) # Print the incomming data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment