Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rename websockets to ws #20

Merged
merged 1 commit into from
May 17, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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