Skip to content

Instantly share code, notes, and snippets.

@vklachkov
Created April 3, 2020 22:14
Show Gist options
  • Save vklachkov/55aebe5aa7fb68bd9c606a73b1504884 to your computer and use it in GitHub Desktop.
Save vklachkov/55aebe5aa7fb68bd9c606a73b1504884 to your computer and use it in GitHub Desktop.
Simple tcp echo client
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(('SERVER', 80))
while True:
raw = s.recv(1024)
print(raw.decode('ascii'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment