@@ -126,15 +126,15 @@ if (has_ipv6)
126
126
var combined = Compose ( [
127
127
Net ( {
128
128
scope : 'private' ,
129
- port : 4848 ,
129
+ port : 4849 ,
130
130
host : 'fe80::1065:74a4:4016:6266%wlan0'
131
131
} ) ,
132
132
shs
133
133
] )
134
134
var addr = combined . stringify ( 'private' )
135
135
t . equal (
136
136
addr ,
137
- 'net:fe80::1065:74a4:4016:6266:4848 ~shs:' +
137
+ 'net:fe80::1065:74a4:4016:6266:4849 ~shs:' +
138
138
keys . publicKey . toString ( 'base64' )
139
139
)
140
140
t . end ( )
@@ -144,7 +144,7 @@ tape('net: do not listen on all addresses', function (t) {
144
144
var combined = Compose ( [
145
145
Net ( {
146
146
scope : 'device' ,
147
- port : 4848 ,
147
+ port : 4850 ,
148
148
host : 'localhost' ,
149
149
// external: scopes.host('private') // unroutable IP, but not localhost (e.g. 192.168 ...)
150
150
} ) ,
@@ -156,7 +156,7 @@ tape('net: do not listen on all addresses', function (t) {
156
156
var fake_combined = Compose ( [
157
157
Net ( {
158
158
scope : 'local' ,
159
- port : 4848 ,
159
+ port : 4851 ,
160
160
//host: 'localhost',
161
161
// external: scopes.host('local') // unroutable IP, but not localhost (e.g. 192.168 ...)
162
162
} ) ,
@@ -175,7 +175,7 @@ tape('net: do not crash if listen() fails', function(t) {
175
175
var combined = Compose ( [
176
176
Net ( {
177
177
scope : 'private' ,
178
- port : 4848 ,
178
+ port : 4852 ,
179
179
host : '$not-a-valid-ip-addr$' ,
180
180
} ) ,
181
181
shs
@@ -187,6 +187,21 @@ tape('net: do not crash if listen() fails', function(t) {
187
187
} )
188
188
} )
189
189
190
+ tape ( 'net: stringify support external being a string' , function ( t ) {
191
+ var combined = Compose ( [
192
+ Net ( {
193
+ scope : 'public' ,
194
+ port : 4853 ,
195
+ host : 'localhost' ,
196
+ external : 'scuttlebutt.nz'
197
+ } ) ,
198
+ shs
199
+ ] )
200
+ var addr = combined . stringify ( 'public' )
201
+ t . equals ( addr , 'net:scuttlebutt.nz:4853~shs:' + keys . publicKey . toString ( 'base64' ) )
202
+ t . end ( )
203
+ } )
204
+
190
205
tape ( 'combined, unix' , function ( t ) {
191
206
var combined = Compose ( [
192
207
Unix ( {
@@ -432,8 +447,8 @@ tape('error should have client address on it', function (t) {
432
447
} )
433
448
434
449
tape ( 'multiple public different hosts' , function ( t ) {
435
- var net1 = Net ( { host : '127.0.0.1' , port : 4848 , scope : 'public' } )
436
- var net2 = Net ( { host : '::1' , port : 4847 , scope : 'public' } )
450
+ var net1 = Net ( { host : '127.0.0.1' , port : 4854 , scope : 'public' } )
451
+ var net2 = Net ( { host : '::1' , port : 4855 , scope : 'public' } )
437
452
438
453
var combined1 = Compose ( [ net1 , shs ] )
439
454
var combined2 = Compose ( [ net2 , shs ] )
@@ -447,8 +462,8 @@ tape('multiple public different hosts', function(t) {
447
462
} )
448
463
449
464
tape ( 'multiple scopes different hosts' , function ( t ) {
450
- var net1 = Net ( { host : '127.0.0.1' , port : 4848 , scope : [ 'local' , 'device' , 'public' ] } )
451
- var net2 = Net ( { host : '::1' , port : 4847 , scope : [ 'local' , 'device' , 'public' ] } )
465
+ var net1 = Net ( { host : '127.0.0.1' , port : 4856 , scope : [ 'local' , 'device' , 'public' ] } )
466
+ var net2 = Net ( { host : '::1' , port : 4857 , scope : [ 'local' , 'device' , 'public' ] } )
452
467
453
468
var combined1 = Compose ( [ net1 , shs ] )
454
469
var combined2 = Compose ( [ net2 , shs ] )
0 commit comments