mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-04 01:59:35 +00:00
Fixes CodeQL py/bind-socket-all-network-interfaces by binding the local debug HTTP printer to 127.0.0.1 instead of all interfaces (host = ''). The script is a small local debugging utility, so restricting it to loopback does not affect its intended use. Assisted-By: Claude Opus 4.8
18 lines
319 B
Python
18 lines
319 B
Python
#!/usr/bin/env python
|
|
|
|
import socket
|
|
|
|
host = '127.0.0.1'
|
|
port = 50000
|
|
backlog = 5
|
|
size = 1024
|
|
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
|
s.bind((host,port))
|
|
s.listen(backlog)
|
|
while 1:
|
|
client, address = s.accept()
|
|
data = client.recv(size)
|
|
if data:
|
|
print data
|
|
client.close()
|