'Can't connect to Flask API running in VM from Host Maschine
I set up a Flask API in a Ubuntu Virtual Maschine (Virtual Box). The VM is on bridged mode. Now i want to request data from the API from the Host System (Windows) and it always tells me that the connection is refused. I tried switching to Host Only but if I try to run the VM with that it instantly crashes. I can ping the VM from Windows but can't get through to Port 5000. I think its either a Virtual Box or a Flask issue. Code of my API:
@app.route('/fnd/<text>', methods=['GET'])
def fnd(text):
print(text)
return jsonify(text)
if __name__ == '__main__':
app.run(host='0.0.0.0',port=5000, Debug=False)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
