Skip to content

Commit

Permalink
Merge pull request #20 from jbenet/rename-websockets-ws
Browse files Browse the repository at this point in the history
rename websockets to ws
  • Loading branch information
daviddias committed May 17, 2016
2 parents 7dabdf3 + 1657bea commit 33bac2f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/protocols.csv
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion src/protocols.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Protocols.table = [
[421, Protocols.lengthPrefixedVarSize, 'ipfs'],
[480, 0, 'http'],
[443, 0, 'https'],
[477, 0, 'websockets']
[477, 0, 'ws']
]

Protocols.names = {}
Expand Down
4 changes: 2 additions & 2 deletions test/convert.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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])
)
Expand All @@ -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'
)
Expand Down
8 changes: 4 additions & 4 deletions test/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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('/')
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 33bac2f

Please sign in to comment.