1
0
mirror of https://github.com/LibreTranslate/LibreTranslate.git synced 2024-11-14 11:40:11 +01:00

fix: make libretranslate with ipv6

This commit is contained in:
Cyril Levis 2024-03-06 15:46:29 +01:00
parent b25ed7aae4
commit 732e984382
No known key found for this signature in database
GPG Key ID: 6DB88737C11F5A48
2 changed files with 5 additions and 1 deletions

View File

@ -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:

View File

@ -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!',