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

Client IP format #8

Open
kevinresol opened this issue Mar 26, 2016 · 6 comments
Open

Client IP format #8

kevinresol opened this issue Mar 26, 2016 · 6 comments
Assignees
Milestone

Comments

@kevinresol
Copy link
Member

The clientIp given by NodeContainer is something like ::ffff:127.0.0.1. I think we need a bit more information about the address than just a plain string, such as the address family IPv4 or IPv6

See: https://nodejs.org/api/net.html#net_socket_remotefamily

@back2dos
Copy link
Member

This is not at all my strong suit. I was happy having something reasonably readable. If you feel that you can improve this, by all means, please do.

@back2dos back2dos added this to the 1.0.0 milestone Jul 8, 2016
@back2dos
Copy link
Member

back2dos commented Jul 8, 2016

I propose to introduce some abstract Ip(String) to String {} for now and then we can add inspection utilities later down the road.

@kevinresol
Copy link
Member Author

https://github.com/whitequark/ipaddr.js/blob/master/test/ipaddr.test.coffee

This seems to be a good test suite to write our code against. Let me have a try.

@kevinresol
Copy link
Member Author

Where do you want to put such class though? I think there is some overlap between this IP class, tink.tcp.Endpoint and tink.url.Host

@back2dos
Copy link
Member

back2dos commented Jul 8, 2016

I am not particularly hurried for the inspection capabilities. My point was rather that we should introduce a specific type before 1.0.0 and then we can add any functionality later, as necessity arises.

As for choosing a location: I guess it would be fine to put all of this into tink_url and let tink_tcp depend on it. It's a small and simple lib. Or we could have a tink_ip library, seeing how ipaddr.js demonstrates quite a lot of IP mangling capabilities. But maybe that's just overkill. I'll leave that for you to judge ;)

@kevinresol
Copy link
Member Author

I understand that.

And I think that IP is different thing than TCP or URL. So I will just make it standalone...
https://github.com/haxetink/tink_ip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants