diff --git a/libretranslate/main.py b/libretranslate/main.py index 8337c70..6866a55 100644 --- a/libretranslate/main.py +++ b/libretranslate/main.py @@ -215,6 +215,10 @@ def main(): if '--wsgi' in sys.argv: return app else: + if args.debug and args.host == "*": + # '::' will listen on both ipv6 and ipv4 + args.host = "::" + if args.debug: app.run(host=args.host, port=args.port) else: diff --git a/scripts/healthcheck.py b/scripts/healthcheck.py index aa5fcaf..2f0d22f 100644 --- a/scripts/healthcheck.py +++ b/scripts/healthcheck.py @@ -1,7 +1,7 @@ import requests response = requests.post( - url='http://[::1]:5000/translate', + url='http://localhost:5000/translate', headers={'Content-Type': 'application/json'}, json={ 'q': 'Hello World!',