diff --git a/src/protocols.csv b/src/protocols.csv index ec9ad5d9..0f9e1ea9 100644 --- a/src/protocols.csv +++ b/src/protocols.csv @@ -10,5 +10,5 @@ code size name 421 V ipfs 480 0 http 443 0 https -477 0 websockets +477 0 ws 444 10 onion diff --git a/src/protocols.js b/src/protocols.js index 9e6d1030..39f07b02 100644 --- a/src/protocols.js +++ b/src/protocols.js @@ -41,7 +41,7 @@ Protocols.table = [ [421, Protocols.lengthPrefixedVarSize, 'ipfs'], [480, 0, 'http'], [443, 0, 'https'], - [477, 0, 'websockets'] + [477, 0, 'ws'] ] Protocols.names = {} diff --git a/test/convert.spec.js b/test/convert.spec.js index f6b47edc..7304fee4 100644 --- a/test/convert.spec.js +++ b/test/convert.spec.js @@ -24,7 +24,7 @@ describe('convert', () => { describe('.toBuffer', () => { it('defaults to hex conversion', () => { expect( - convert.toBuffer('websockets', 'c0a80001') + convert.toBuffer('ws', 'c0a80001') ).to.be.eql( new Buffer([192, 168, 0, 1]) ) @@ -43,7 +43,7 @@ describe('convert', () => { it('defaults to hex conversion', () => { expect( - convert.toString('websockets', new Buffer([192, 168, 0, 1])) + convert.toString('ws', new Buffer([192, 168, 0, 1])) ).to.be.eql( 'c0a80001' ) diff --git a/test/index.spec.js b/test/index.spec.js index 71dfdb8c..e0582264 100644 --- a/test/index.spec.js +++ b/test/index.spec.js @@ -105,7 +105,7 @@ describe('manipulation', () => { const ipfsAddr = multiaddr('/ipfs/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSupNKC') const ip6Addr = multiaddr('/ip6/2001:8a0:7ac5:4201:3ac9:86ff:fe31:7095') const tcpAddr = multiaddr('/tcp/8000') - const webAddr = multiaddr('/websockets') + const webAddr = multiaddr('/ws') expect( multiaddr('/') @@ -258,21 +258,21 @@ describe('variants', () => { }) it('ip4 + tcp + websockets', () => { - const str = '/ip4/127.0.0.1/tcp/8000/websockets' + const str = '/ip4/127.0.0.1/tcp/8000/ws' const addr = multiaddr(str) expect(addr).to.have.property('buffer') expect(addr.toString()).to.equal(str) }) it('ip6 + tcp + websockets', () => { - const str = '/ip6/2001:8a0:7ac5:4201:3ac9:86ff:fe31:7095/tcp/8000/websockets' + const str = '/ip6/2001:8a0:7ac5:4201:3ac9:86ff:fe31:7095/tcp/8000/ws' const addr = multiaddr(str) expect(addr).to.have.property('buffer') expect(addr.toString()).to.equal(str) }) it('ip6 + tcp + websockets + ipfs', () => { - const str = '/ip6/2001:8a0:7ac5:4201:3ac9:86ff:fe31:7095/tcp/8000/websockets/ipfs/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSupNKC' + const str = '/ip6/2001:8a0:7ac5:4201:3ac9:86ff:fe31:7095/tcp/8000/ws/ipfs/QmcgpsyWgH8Y8ajJz1Cu72KnS5uo2Aa2LpzU7kinSupNKC' const addr = multiaddr(str) expect(addr).to.have.property('buffer') expect(addr.toString()).to.equal(str)