Compare commits

..

2 commits

Author SHA1 Message Date
Frank Villaro-Dixon 92d6e2363b aouua
All checks were successful
ci / docker (push) Successful in 1m11s
Signed-off-by: Frank Villaro-Dixon <frank@villaro-dixon.eu>
2024-09-02 12:09:16 +02:00
Frank Villaro-Dixon 33af9c8e9b fix cleanup
Signed-off-by: Frank Villaro-Dixon <frank@villaro-dixon.eu>
2024-09-02 12:07:33 +02:00
2 changed files with 6 additions and 4 deletions

View file

@ -5,6 +5,7 @@ on:
branches: branches:
- "cicd" - "cicd"
- main - main
- '*'
jobs: jobs:
docker: docker:
@ -27,4 +28,4 @@ jobs:
with: with:
context: . context: .
push: true push: true
tags: forge.k3s.fr/frank/kube-escape:latest tags: "forge.k3s.fr/frank/kube-escape:${{ github.ref_name }}"

7
pod.py
View file

@ -16,7 +16,7 @@ async def handle_socket_read(socketid, tcpreader, ws):
print(f"New socket: {socketid}. Waiting on recv") print(f"New socket: {socketid}. Waiting on recv")
while True: while True:
data = await tcpreader.read(2024) data = await tcpreader.read(2024)
#print(f"TCP@{socketid} Received {len(data)} bytes") print(f"TCP@{socketid} Received {len(data)} bytes")
if data == b'': if data == b'':
print(f"TCP@{socketid} Connection closed") print(f"TCP@{socketid} Connection closed")
c = conn.WSMsg(socketid, conn.MsgType.DISCONNECT) c = conn.WSMsg(socketid, conn.MsgType.DISCONNECT)
@ -24,7 +24,7 @@ async def handle_socket_read(socketid, tcpreader, ws):
break break
c = conn.WSMsg(socketid, conn.MsgType.DATA, data) c = conn.WSMsg(socketid, conn.MsgType.DATA, data)
#print(f'TCP>WS: {c}') print(f'TCP>WS: {c}')
await ws.send(c.to_bytes()) await ws.send(c.to_bytes())
except Exception as e: except Exception as e:
@ -62,8 +62,9 @@ async def handle_ws_incoming(cfg, ws, sockets):
elif c.msg == conn.MsgType.DATA: elif c.msg == conn.MsgType.DATA:
tcpreader, tcpwriter = sockets[socketid] tcpreader, tcpwriter = sockets[socketid]
#print(f'WS>TCP: {c}') print(f'WS>TCP: {c}')
tcpwriter.write(c.payload) tcpwriter.write(c.payload)
print('written')
def get_config(): def get_config():