-
Notifications
You must be signed in to change notification settings - Fork 20
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
how to get ip from connect socket? #8
Comments
You need to access _socket, but since it's private, you need to create new class e.g. |
thank you ,@Tezar |
Or just use |
I am not that well versed in the Haxe, so this solution comed as little surprise. Documentation seems little problematic to google up (at least for me) so quick intro to anyone going to same path. You can access private vars like this
Or by specifying
Also note, that |
I guess it makes sense to for this to be added into the actual api also? If someone doesnt make a PR ill make one in the next few days. Cheers guys! |
Well, it is IP4 address, which is stored as 4bytes (hence the range 0-255, since thats tha maximum value 1 byte can hold). The usual format is just human friendly way of writing it down. IP you send is 01 00 00 7F in hexa, which corresponds to 127.0.0.1 (dont get confused by big/little endian stuff). If you want more on this topic, I recommend to start on wiki and go from there, this stuff is programing language agnostic, so you will benefit from it anywhere. You can safely use this format for comparsion and other stuff, but for output expected by you, you can try to call host.toString() |
it's seem well
|
host = ws._socket.host() the result is server ip instead of client ip |
|
👍 @Tezar |
hi @Tezar ,ip is right.but port is wrong
my port is 12011,and got the result is 50444? |
Hi @sonygod, |
@sonygod any progress on this? |
how to get ip from connect socket?
The text was updated successfully, but these errors were encountered: