Stremio / stremio-addon-sdk

🧙 A Node.js SDK for creating and publishing Stremio add-ons
https://www.stremio.com/addon-sdk
MIT License
646 stars 173 forks source link

Unable to retrieve the client IP ADRESS #222

Open phantazma opened 1 year ago

phantazma commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 7 months ago

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(); });