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

Requesting IP address for node.http.ServerRequest #5

Closed
Connorhd opened this issue Jun 4, 2009 · 4 comments
Closed

Requesting IP address for node.http.ServerRequest #5

Connorhd opened this issue Jun 4, 2009 · 4 comments

Comments

@Connorhd
Copy link

Connorhd commented Jun 4, 2009

There currently seems to be no way of finding out the source of a request using nodes http server. Any chance of this being added, maybe req.remoteHost?

Thanks,

@ujh
Copy link

ujh commented Jun 5, 2009

Apparently that's not as easy to do. If this gets implemented one should definitely look at how Rails did it in remote_ip. Proxies and security issues seem to make it more complicated.

@Connorhd
Copy link
Author

Connorhd commented Jun 5, 2009

I don't think proxies make it more complicated to implement, once you make the remote IP available the script itself can decide whether or not to make use of X_FORWARDED_FOR or other such headers (its worth noting anyone can set these headers to anything so they can't be used without some level of trust).

@ujh
Copy link

ujh commented Jun 5, 2009

You are right of course. That's not something the ServerRequest should care about.

@ry
Copy link

ry commented Jun 5, 2009

Fixed in 5558bc4. connection.remoteAddress. In an http server res.connection.remoteAddress.

bnoordhuis added a commit that referenced this issue Apr 10, 2013
Call SetPointerInInternalField(0, NULL) rather than
SetInternalField(0, Undefined()).

Fixes the following spurious NULL pointer dereference in debug builds:

  #0  0x03ad2821 in v8::internal::FixedArrayBase::length ()
  #1  0x03ad1dfc in v8::internal::FixedArray::get ()
  #2  0x03ae05dd in v8::internal::Context::global_object ()
  #3  0x03b6b87d in v8::internal::Context::builtins ()
  #4  0x03ae1871 in v8::internal::Isolate::js_builtins_object ()
  #5  0x03ab4fab in v8::CallV8HeapFunction ()
  #6  0x03ab4d4a in v8::Value::Equals ()
  #7  0x03b4f38b in CheckEqualsHelper ()
  #8  0x03ac0f4b in v8::Object::SetInternalField ()
  #9  0x06a99ddd in node::ObjectWrap::~ObjectWrap ()
  #10 0x06a8b051 in node::Buffer::~Buffer ()
  #11 0x06a8afbb in node::Buffer::~Buffer ()
  #12 0x06a8af5e in node::Buffer::~Buffer ()
  #13 0x06a9e569 in node::ObjectWrap::WeakCallback ()
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants