mirror of
https://github.com/clearlinux/uwsgi.git
synced 2026-08-19 03:57:21 +00:00
15 lines
317 B
Python
15 lines
317 B
Python
import socket
|
|
import sys
|
|
|
|
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
|
|
|
(addr, port) = sys.argv[1].split(':')
|
|
s.connect((addr, int(port)))
|
|
|
|
s.send("POST /send HTTP/1.1\r\n")
|
|
s.send("Transfer-Encoding: chunked\r\n\r\n")
|
|
|
|
while True:
|
|
msg = raw_input("msg >> ")
|
|
s.send("%X\r\n%s\r\n" % (len(msg), msg))
|