mirror of
https://github.com/tun2proxy/tun2proxy.git
synced 2025-06-05 06:10:15 +00:00
Parameterize IP addresses in manual tests
This commit is contained in:
parent
70cea8e11f
commit
fd48be5feb
2 changed files with 8 additions and 2 deletions
|
@ -1,8 +1,11 @@
|
||||||
import socket
|
import socket
|
||||||
import time
|
import time
|
||||||
|
import sys
|
||||||
|
|
||||||
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
|
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
|
||||||
s.connect(('116.203.215.166', 1337))
|
ip, port = sys.argv[1].split(':', 1)
|
||||||
|
port = int(port)
|
||||||
|
s.connect((ip, port))
|
||||||
s.sendall('I am closing the write end, but I can still receive data'.encode())
|
s.sendall('I am closing the write end, but I can still receive data'.encode())
|
||||||
s.shutdown(socket.SHUT_WR)
|
s.shutdown(socket.SHUT_WR)
|
||||||
while True:
|
while True:
|
||||||
|
|
|
@ -1,8 +1,11 @@
|
||||||
import socket
|
import socket
|
||||||
|
import sys
|
||||||
import time
|
import time
|
||||||
|
|
||||||
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
|
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
|
||||||
s.connect(('116.203.215.166', 1337))
|
ip, port = sys.argv[1].split(':', 1)
|
||||||
|
port = int(port)
|
||||||
|
s.connect((ip, port))
|
||||||
while True:
|
while True:
|
||||||
data = s.recv(1024)
|
data = s.recv(1024)
|
||||||
if not data:
|
if not data:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue