@@ -4061,17 +4061,24 @@ def test_old_feerate(node_factory):
4061
4061
@pytest .mark .developer ("needs --dev-allow-localhost" )
4062
4062
def test_websocket (node_factory ):
4063
4063
ws_port = reserve ()
4064
- port1 , port2 = reserve (), reserve ()
4065
- # We need a wildcard to show the websocket bug, but we need a real
4066
- # address to give us something to announce.
4064
+ port = reserve ()
4067
4065
l1 , l2 = node_factory .line_graph (2 ,
4068
- opts = [{'experimental-websocket-port' : ws_port ,
4069
- 'addr' : [':' + str (port1 ),
4070
- '127.0.0.1: ' + str (port2 )],
4066
+ opts = [{'addr' : ':' + str (port ),
4067
+ 'bind-addr' : 'ws:127.0.0.1: ' + str (ws_port ),
4071
4068
'dev-allow-localhost' : None },
4072
4069
{'dev-allow-localhost' : None }],
4073
4070
wait_for_announce = True )
4074
- assert l1 .rpc .listconfigs ()['experimental-websocket-port' ] == ws_port
4071
+ # Some depend on ipv4 vs ipv6 behaviour...
4072
+ for b in l1 .rpc .getinfo ()['binding' ]:
4073
+ if b ['type' ] == 'ipv4' :
4074
+ assert b == {'type' : 'ipv4' , 'address' : '0.0.0.0' , 'port' : port }
4075
+ elif b ['type' ] == 'ipv6' :
4076
+ assert b == {'type' : 'ipv6' , 'address' : '::' , 'port' : port }
4077
+ else :
4078
+ assert b == {'type' : 'websocket' ,
4079
+ 'address' : '127.0.0.1' ,
4080
+ 'subtype' : 'ipv4' ,
4081
+ 'port' : ws_port }
4075
4082
4076
4083
# Adapter to turn websocket into a stream "connection"
4077
4084
class BinWebSocket (object ):
0 commit comments