mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-22 06:41:44 +01:00
lightningd: deprecated experimental-websocket-port now we can use bind=ws:
Changelog-Deprecated: `experimental-websocket-port`: use `--bind=ws::<portnum>`. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
3d5367278b
commit
fafeb65012
2 changed files with 18 additions and 10 deletions
|
@ -1081,6 +1081,9 @@ static char *opt_set_websocket_port(const char *arg, struct lightningd *ld)
|
|||
u32 port COMPILER_WANTS_INIT("9.3.0 -O2");
|
||||
char *err;
|
||||
|
||||
if (!deprecated_apis)
|
||||
return "--experimental-websocket-port been deprecated, use --bind=ws:...";
|
||||
|
||||
err = opt_set_u32(arg, &port);
|
||||
if (err)
|
||||
return err;
|
||||
|
@ -1364,9 +1367,7 @@ static void register_opts(struct lightningd *ld)
|
|||
|
||||
opt_register_arg("--experimental-websocket-port",
|
||||
opt_set_websocket_port, NULL,
|
||||
ld,
|
||||
"experimental: alternate port for peers to connect"
|
||||
" using WebSockets (RFC6455)");
|
||||
ld, opt_hidden);
|
||||
opt_register_noarg("--experimental-upgrade-protocol",
|
||||
opt_set_bool, &ld->experimental_upgrade_protocol,
|
||||
"experimental: allow channel types to be upgraded on reconnect");
|
||||
|
|
|
@ -4058,17 +4058,24 @@ def test_old_feerate(node_factory):
|
|||
@pytest.mark.developer("needs --dev-allow-localhost")
|
||||
def test_websocket(node_factory):
|
||||
ws_port = reserve()
|
||||
port1, port2 = reserve(), reserve()
|
||||
# We need a wildcard to show the websocket bug, but we need a real
|
||||
# address to give us something to announce.
|
||||
port = reserve()
|
||||
l1, l2 = node_factory.line_graph(2,
|
||||
opts=[{'experimental-websocket-port': ws_port,
|
||||
'addr': [':' + str(port1),
|
||||
'127.0.0.1: ' + str(port2)],
|
||||
opts=[{'addr': ':' + str(port),
|
||||
'bind-addr': 'ws:127.0.0.1: ' + str(ws_port),
|
||||
'dev-allow-localhost': None},
|
||||
{'dev-allow-localhost': None}],
|
||||
wait_for_announce=True)
|
||||
assert l1.rpc.listconfigs()['experimental-websocket-port'] == ws_port
|
||||
# Some depend on ipv4 vs ipv6 behaviour...
|
||||
for b in l1.rpc.getinfo()['binding']:
|
||||
if b['type'] == 'ipv4':
|
||||
assert b == {'type': 'ipv4', 'address': '0.0.0.0', 'port': port}
|
||||
elif b['type'] == 'ipv6':
|
||||
assert b == {'type': 'ipv6', 'address': '::', 'port': port}
|
||||
else:
|
||||
assert b == {'type': 'websocket',
|
||||
'address': '127.0.0.1',
|
||||
'subtype': 'ipv4',
|
||||
'port': ws_port}
|
||||
|
||||
# Adapter to turn websocket into a stream "connection"
|
||||
class BinWebSocket(object):
|
||||
|
|
Loading…
Add table
Reference in a new issue