update
This commit is contained in:
parent
de873dd1be
commit
6c7eff0323
@ -61,12 +61,14 @@ def main() -> int:
|
|||||||
def read_from_tun():
|
def read_from_tun():
|
||||||
while True:
|
while True:
|
||||||
data = tun_interface.read(1500)
|
data = tun_interface.read(1500)
|
||||||
|
print("O: ", [hex(byte) for byte in data], file=sys.stderr, flush=True)
|
||||||
sys.stdout.buffer.write(data)
|
sys.stdout.buffer.write(data)
|
||||||
sys.stdout.buffer.flush()
|
sys.stdout.buffer.flush()
|
||||||
|
|
||||||
def write_to_tun():
|
def write_to_tun():
|
||||||
while True:
|
while True:
|
||||||
data = sys.stdin.buffer.read(1500)
|
data = sys.stdin.buffer.read(1500)
|
||||||
|
print("I: ", [hex(byte) for byte in data], file=sys.stderr, flush=True)
|
||||||
tun_interface.write(data)
|
tun_interface.write(data)
|
||||||
|
|
||||||
read_thread = threading.Thread(target=read_from_tun)
|
read_thread = threading.Thread(target=read_from_tun)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user