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