[+] add auto addr search for public, http-server
This commit is contained in:
parent
a912e1b6bf
commit
dc39583cc6
@ -1215,6 +1215,21 @@ def http_server(argv):
|
||||
assert options.port >= 1
|
||||
|
||||
try:
|
||||
if options.public and options.host == '0.0.0.0':
|
||||
found : bool = False
|
||||
for o in commands_os.interfaces_index():
|
||||
if found:
|
||||
break
|
||||
for o2 in o.addr_info:
|
||||
if o2.family == 'inet' and o2.local != '127.0.0.1':
|
||||
options.host = o2.local
|
||||
logger.info(dict(
|
||||
host=options.host,
|
||||
msg='found',
|
||||
))
|
||||
found = True
|
||||
break
|
||||
|
||||
assert not socket.inet_aton(options.host) is None
|
||||
# subprocess.check_call([
|
||||
# 'ping', '-w', '1',
|
||||
|
@ -1,6 +1,6 @@
|
||||
[project]
|
||||
name = 'online.fxreader.pr34'
|
||||
version = '0.1.5.9+27.2'
|
||||
version = '0.1.5.9+27.3'
|
||||
|
||||
dependencies = [
|
||||
#"-r requirements.txt",
|
||||
|
BIN
releases/whl/online_fxreader_pr34-0.1.5.9+27.3-py3-none-any.whl
(Stored with Git LFS)
Normal file
BIN
releases/whl/online_fxreader_pr34-0.1.5.9+27.3-py3-none-any.whl
(Stored with Git LFS)
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user