nanoexpress / legacy

[Deprecated] Nano-framework for Node.js. Use PRO version
https://nanoexpress.js.org
Apache License 2.0
107 stars 13 forks source link

Add `getIP` to Typescript typings #66

Closed blitss closed 4 years ago

blitss commented 4 years ago

It appears that we have getIP method which doesn't exist in TS typings. https://github.com/dalisoft/nanoexpress/blob/master/src/wrappers/http/request.js#L21

dalisoft commented 4 years ago

Hi @Blitss

Thanks for PR and thanks for using nanoexpress. But there one moment. HttpRequest.getIP is not stable method and it's not recommended for Production usage.

Sorry, because this is undocumented well

blitss commented 4 years ago

Ok, thanks. I guess it only works with IPv4 addresses?

It'd be great if you added a support for both IPv6 and trust proxy, such as Nginx.

dalisoft commented 4 years ago

I hope it will, but i cannot add this until uWebSockets.js add this. This method very slow and unstable, i decided not add to API, but still works sometimes as experimental