from flask import Flask, request
app = Flask(name)
@app.route('/log-ip', methods=['POST']) def log_ip(): data = request.json with open("webrtc_ips.txt", "a") as file: file.write(f"{data['ip']}\n") return "Logged", 200
if name == 'main': app.run(host='0.0.0.0', port=5000)