mirror of
https://github.com/LibreTranslate/LibreTranslate.git
synced 2024-11-14 19:50:11 +01:00
fix: make libretranslate with ipv6
This commit is contained in:
parent
b25ed7aae4
commit
732e984382
@ -215,6 +215,10 @@ def main():
|
|||||||
if '--wsgi' in sys.argv:
|
if '--wsgi' in sys.argv:
|
||||||
return app
|
return app
|
||||||
else:
|
else:
|
||||||
|
if args.debug and args.host == "*":
|
||||||
|
# '::' will listen on both ipv6 and ipv4
|
||||||
|
args.host = "::"
|
||||||
|
|
||||||
if args.debug:
|
if args.debug:
|
||||||
app.run(host=args.host, port=args.port)
|
app.run(host=args.host, port=args.port)
|
||||||
else:
|
else:
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import requests
|
import requests
|
||||||
|
|
||||||
response = requests.post(
|
response = requests.post(
|
||||||
url='http://[::1]:5000/translate',
|
url='http://localhost:5000/translate',
|
||||||
headers={'Content-Type': 'application/json'},
|
headers={'Content-Type': 'application/json'},
|
||||||
json={
|
json={
|
||||||
'q': 'Hello World!',
|
'q': 'Hello World!',
|
||||||
|
Loading…
Reference in New Issue
Block a user