Answer the question
In order to leave comments, you need to log in
How to open ports for your internet server?
How to open ports of white ip address? It turns out that I open the port only gray, tk. only I can connect to the server from the server itself.
I try to connect through a regular browser - there is an answer. I try to connect via Tor or I ask a friend to connect to me - there is no connection.
In the router settings, I opened port 2000
In the windows firewall, I also opened port for incoming connections 2000
Server code:
from flask import Flask, request, jsonify
app = Flask(__name__)
@app.route('/price', methods=['GET', 'POST'])
def price():
if request.method == 'POST':
price = request.form['price']
if int(price) < 1000:
return jsonify({'msg': 'Нищий'})
else:
# Сюда алгоритм
return jsonify({'msg': 'Вот тебе компьюдахтех'})
else:
return {'msg': '!'}
if __name__ == '__main__':
app.run(host='0.0.0.0')
Answer the question
In order to leave comments, you need to log in
Well, for starters, if there is no error, then the server is running on port 5000. Are you connecting to port 2000 via LAN?
Next - turn off the Windows firewall and antivirus in general, check
Do you even have an external IP from the provider? Have you subscribed to this service?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question