+12
-5
@@ -27,4 +27,4 @@ /* | ||
| options = options || {}; | ||
| mesh.host = options.host || '127.0.0.1'; | ||
| mesh.port = options.port || '1234'; | ||
| mesh.host = mesh.host || options.host || '127.0.0.1'; | ||
| mesh.port = mesh.port || options.port || '1234'; | ||
@@ -49,2 +49,3 @@ console.log('Connecting to ' + mesh.host + ':' + mesh.port + '...'); | ||
| mesh.name = function(name){ | ||
| if (name.indexOf('::') != -1) throw new Error('Name cannot contain ::'); | ||
| if (typeof name != 'string') return mesh; | ||
@@ -117,5 +118,11 @@ mesh.nameBuffer = name; | ||
| } | ||
| } else if (m == 'BNAMEACCEPT') { | ||
| mesh.id = mesh.nameBuffer; | ||
| console.log('ID: ' + mesh.nameBuffer); | ||
| } else if (m.indexOf('BNAMEACCEPT') != -1) { | ||
| var raw = m.split('::'); | ||
| if (raw[1] != mesh.nameBuffer) { | ||
| console.log('Server did not accept name request. Accepting server-provided ID: ' + raw[1]); | ||
| } else { | ||
| console.log('Server accepted name request.'); | ||
| } | ||
| mesh.id = raw[1]; | ||
| console.log('ID: ' + mesh.id); | ||
| } else { | ||
@@ -122,0 +129,0 @@ try { |
+1
-1
@@ -5,3 +5,3 @@ { | ||
| "description": "Send messages to any nodejs process, anywhere on the Internet.", | ||
| "version": "0.1.0", | ||
| "version": "0.1.1", | ||
| "homepage": "http://bolt.io/", | ||
@@ -8,0 +8,0 @@ "repository": { |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
6967
5.21%162
4.52%