Encountered the problem while setting up a small IPv6-only API endpoint.
from flask import Flask
app = Flask(__name__)
@app.route("/", methods=["GET"])
def hello(res):
print("Hello world")
if __name__ == "__main__":
import bjoern
bjoern.run(app, "::1", 2018)
Traceback (most recent call last):
File "vpmf.py", line 12, in <module>
bjoern.run(app, '::1', 2018)
File "/usr/local/lib64/python3.6/site-packages/bjoern.py", line 68, in run
listen(*args, **kwargs)
File "/usr/local/lib64/python3.6/site-packages/bjoern.py", line 52, in listen
sock = bind_and_listen(host, port, reuse_port)
File "/usr/local/lib64/python3.6/site-packages/bjoern.py", line 30, in bind_and_listen
sock.bind((host, port))
socket.gaierror: [Errno -9] Address family for hostname not supported
Encountered the problem while setting up a small IPv6-only API endpoint.
Minimal code:
Error: