Files
sailing-analytics/configuration/httpprinter.py
T
Axel Uhl 22e789d921 Bind httpprinter debug socket to loopback only
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
2026-10-05 18:37:26 +02:00

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()