-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Socket.remoteAddress is undefined on windows. #1345
Comments
I would be glad if an update can be given on this, since it impedes the ability to test node sockets on Windows. I'm on Windows 7 SP1 |
Confirmed on XP pro sp3 for req.connection.remoteAddress. Gives undefined. |
Does |
On XP with node.exe the above test just exits right after starting in console and didn't output anything or throw anything. There is no server listening so I'm not sure what to make of the test? |
Right, turns out there's a bug in that test (see f52a8db) so let's disregard that. Maybe I can sneak in a patch for today's release but consider it broken for now. |
79f064f should fix it. If someone has the chance to test it on Windows, that'd be awesome. |
Looks like remoteAddress is still undefined. Here's what I got in XP pro sp3:- C:\Nodejs>node testRemoteAddress.js assert.js:93 C:\Nodejs> |
@plexel: what commit is your master branch at and do you still have the problem after a |
@ bnoordhuis: sorry but I have no idea what you are talking about? |
@plexel: I assume you're using the pre-built binaries? I was looking for people who build node from source (and from our repository). |
Sorry, I used the prebuilt windows binary when I reported this bug. Windows On 12 August 2011 16:03, bnoordhuis <
|
@Floby: No worries. We're releasing WIndows builds on a weekly basis. Just make sure you're running the latest and greatest when reporting issues. |
Thanks bnoordhuis. Works perfectly in Node 0.5.4 :). On Fri, 12 Aug 2011 14:47:20 -0000, bnoordhuis
|
@ bnoordhuis: Yes node.exe version 0.5.3 I believe. I now tried your test with node.exe version 0.5.4 and socket.remoteAddress is showing 127.0.0.1 I am running an http and an https node 0.5.4 server on my laptop at localhost:80 and localhost:443 respectively. Both are accessible from the internet. What I want to know is the IP address of callers but that is still not possible. I have to use the following queries for requests at present:- http server https server I do not know why .socket must be used with https and not http but that is another issue. If I do remote internet requests to these two node 0.5.4 servers using http://web-sniffer.net I get this:- http server https server 192.168.1.100 is the IP address of my laptop in my LAN behind the adsl router. But what I want to know is the IP of web-sniffer.net. Shouldn't that should be the remoteAddress? Is it right that socket.remoteAddress is the same as socket.address().address? On 12/08/2011 3:03 pm, bnoordhuis wrote:
|
Right you are, it's broken with function server(peer) {
console.error(peer.remoteAddress, peer.remotePort)
peer.write("OK\n", function() { peer.destroy() })
}
require('net').createServer(server).listen(8080)
127.127.127.127 19722 (legacy) libuv passes in the server address, not the remote address. |
i approve this behavior. it prints the servers ip instead of the clients ip. also the port it tells is the server port |
You can get the server ip from socket.address().address so why get it also from socket.remoteAddress. remoteAddress should be the client ip address, otherwise where can you get it? |
@bnoordhuis ah yes, sorry. Is it hard to change the remote address to the client address? How long for a fix? On 16/08/2011 15:31, bnoordhuis wrote:
|
now in 0.5.5 it still shows the server ip and port instead of the client ip and port. |
Targeted for 0.5.6. Needs |
thank you for targeting it. without it login forms would be attackable by brute force. |
I tested the following code on windows with the node 0.5.1 executable released yesterday.
Hitting the server on both http and tcp ends logs
connection from undefined
orgot connection from undefined
. Note that I did not try to hit the servers from a distant machine. Everything is from localhost.Expected behavior : socket.remoteAddress is set to the client remote ip address (in this case 127.0.0.1 or equivalent).
Node Version: 0.5.1
uv: 0.1
Windows XP pro SP3.
The text was updated successfully, but these errors were encountered: