Intoducing websocket_announce configuration
Currently electrum daemon runs websocket server on a configured host and port and sends the same information to merchant payments. There is likely that those two may be different, when websocket traffic is being reverse proxied and sent over via different hosts. This patch introduces two fully optional parameters, websocket_server_announce and websocket_port_announce, which when set, are sent to the merchant payments instead of websocket_server and websocket_port values.
This commit is contained in:
parent
569a3b4fab
commit
07280730d4
|
@ -1054,7 +1054,15 @@ class Abstract_Wallet(PrintError):
|
||||||
out['request_url'] = os.path.join(baseurl, key)
|
out['request_url'] = os.path.join(baseurl, key)
|
||||||
out['URI'] += '&r=' + out['request_url']
|
out['URI'] += '&r=' + out['request_url']
|
||||||
out['index_url'] = os.path.join(baseurl, 'index.html') + '?id=' + key
|
out['index_url'] = os.path.join(baseurl, 'index.html') + '?id=' + key
|
||||||
|
websocket_server_announce = config.get('websocket_server_announce')
|
||||||
|
if websocket_server_announce:
|
||||||
|
out['websocket_server'] = websocket_server_announce
|
||||||
|
else:
|
||||||
out['websocket_server'] = config.get('websocket_server', 'localhost')
|
out['websocket_server'] = config.get('websocket_server', 'localhost')
|
||||||
|
websocket_port_announce = config.get('websocket_port_announce')
|
||||||
|
if websocket_port_announce:
|
||||||
|
out['websocket_port'] = websocket_port_announce
|
||||||
|
else:
|
||||||
out['websocket_port'] = config.get('websocket_port', 9999)
|
out['websocket_port'] = config.get('websocket_port', 9999)
|
||||||
return out
|
return out
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue