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

Unable to retrieve the client IP ADRESS #222

Open
phantazma opened this issue Jun 14, 2023 · 4 comments
Open

Unable to retrieve the client IP ADRESS #222

phantazma opened this issue Jun 14, 2023 · 4 comments

Comments

@phantazma
Copy link

Hello guys,
Im trying to create a new addon that works with m3U8 streams, those streams use the user IP adress ( not the ip adress of the stremio plateform or the server where the addon is hosted)

how can i retrieve this information ?

@jaruba
Copy link
Member

jaruba commented Jun 14, 2023

how will you even ensure that the user has the port open to the internet for such a transaction?

presuming that you know what you're doing, you could use express with nodejs to create the addon instead of using the addon sdk, then just: https://stackoverflow.com/questions/10849687/express-js-how-to-get-remote-client-address

@phantazma
Copy link
Author

how will you even ensure that the user has the port open to the internet for such a transaction?

presuming that you know what you're doing, you could use express with nodejs to create the addon instead of using the addon sdk, then just: https://stackoverflow.com/questions/10849687/express-js-how-to-get-remote-client-address

i tried to do that but i still get the ip address of the stremio plateform not the public ip of the client

@dexter21767-dev
Copy link
Member

how will you even ensure that the user has the port open to the internet for such a transaction?
presuming that you know what you're doing, you could use express with nodejs to create the addon instead of using the addon sdk, then just: https://stackoverflow.com/questions/10849687/express-js-how-to-get-remote-client-address

i tried to do that but i still get the ip address of the stremio plateform not the public ip of the client

can you share the code you tried?

@mkcfdc
Copy link

mkcfdc commented Feb 8, 2024

Express will allow you to do this.

app.use((req, res, next) => { const ip = req.ip || req.connection.remoteAddress; console.log("User's IP address:", ip); next(); });

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

4 participants