mirror of
https://github.com/go-gost/gost.git
synced 2026-10-08 12:05:46 +00:00
e2e: add PROXY protocol test (gost#677), bump core/x deps
ProxyProtoSuite starts gost with metadata.proxyProtocol set and asserts the HAProxy PROXY header is prepended on outbound connections (v1/v2), backed by a raw-TCP capture script and configs. Add echo754_repro.py from the hot-reload EADDRINUSE investigation (gost#754). Bump github.com/go-gost/core to v0.6.1 and x to v0.16.0.
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import socket, threading
|
||||
|
||||
s = socket.socket()
|
||||
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
|
||||
s.bind(("127.0.0.1", 15738))
|
||||
s.listen(50)
|
||||
|
||||
def loop(c):
|
||||
try:
|
||||
while True:
|
||||
d = c.recv(65536)
|
||||
if not d:
|
||||
break
|
||||
c.sendall(d)
|
||||
except OSError:
|
||||
pass
|
||||
finally:
|
||||
c.close()
|
||||
|
||||
while True:
|
||||
c, _ = s.accept()
|
||||
threading.Thread(target=loop, args=(c,), daemon=True).start()
|
||||
Reference in New Issue
Block a user