Skip to content
This repository has been archived by the owner on Jul 21, 2023. It is now read-only.

[WIP] feat: dns support for WS #47

Merged
merged 7 commits into from
Mar 23, 2017
Merged

Conversation

dryajov
Copy link
Member

@dryajov dryajov commented Feb 19, 2017

@diasdavid Let me know if this is more or less whats needed for dns multiaddress support... (it did send me down the rabbit hole 😛 )

@dryajov
Copy link
Member Author

dryajov commented Feb 20, 2017

tests are failing because of libp2p/interface-transport#23

test/node.js Outdated
@@ -179,11 +185,15 @@ describe('filter addrs', () => {
const mh2 = multiaddr('/ip4/127.0.0.1/udp/9090')
const mh3 = multiaddr('/ip4/127.0.0.1/tcp/9090/ws')
const mh4 = multiaddr('/ip4/127.0.0.1/tcp/9090/ws/ipfs/Qmb6owHp6eaWArVbcJJbQSyifyJBttMMjYV76N2hMbf5Vw')
const mh5 = multiaddr('/dns/ipfs.io/ws')
const mh6 = multiaddr('/dns/ipfs.io/ws/ipfs/Qmb6owHp6eaWArVbcJJbQSyifyJBttMMjYV76N2hMbf5Vw')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to also account for addresses like

/dns/ipfs.io/tcp/80/ws/ipfs/Qmb6owHp6eaWArVbcJJbQSyifyJBttMMjYV76N2hMbf5Vw

otherwise you can't specify the port

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes these need /tcp/80/wss or /tcp/443/wss, and it needs to be /dns4 or /dns6

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah :) I'll add those.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, actually, default for just /ws is port 80 and /wss is port 443, that's it.

@dryajov still up to finish this? It would be sweet for the 0.23 release! :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@diasdavid yep, I'll get this in.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome @dryajov :)

Copy link
Member Author

@dryajov dryajov Mar 22, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@diasdavid @lgierth I think we're talking about having both /tcp/80/wss and /tcp/443/ws for non standard ports? They are both valid cases and should be supported, right?

Copy link
Member Author

@dryajov dryajov Mar 22, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Turns out that we apparently don't support ports in DNS address in js-mafmt, here is a PR that addresses it - multiformats/js-mafmt#15. I'm not entirely sure its the right approach here, but it seems to work.

With this PR in mafmt, I have most of the tests passing here, I should be able to get them all passing soon. I'll push as soon as I have everything working.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dryajov published mafmt for you :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

multiaddr('/ip4/127.0.0.1/tcp/9093/ws')
multiaddr('/ip4/127.0.0.1/tcp/9092/wss'),
multiaddr('/dns4/awesome-dns-server.com/tcp/9092/ws'),
multiaddr('/dns4/awesome-dns-server.com/tcp/9092/wss')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will fail as these hosts don't exist.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, those should fail... They are being intentionally filtered out, according to the test.

Not the clearest test case, some refactoring might make sense.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything should be passing right now. I also refactored the existing tests.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re: compliance addresses, you are right, i was talking about something else. I'll make those point to existing hosts.

@daviddias daviddias changed the base branch from master to feat/dns-support March 23, 2017 14:47
@daviddias
Copy link
Member

merging to a branch in the repo so that I can push changes (most cleaning up unnecessary changes)

@daviddias daviddias merged commit 0a36767 into libp2p:feat/dns-support Mar 23, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants