1

Im wondering if there is a way to only accept http requests from target react-native app.

What i mean is, currently, my nodejs server (using express) accepts connections from any means (even postman requests). Is there a way to make server only listen to desired app?

MacFlyer
  • 219
  • 1
  • 3
  • 13

2 Answers2

1

Use some level of security tokens. I use Passport-JWT with JSON Web Tokens that are generated after the user logs in.

Mark S.
  • 3,849
  • 4
  • 20
  • 22
0

TCP/IP is client agnostic so the server will always allow connections from anyone not on an IP based blacklist. However you can easily use tokens, keyword parameters or other means to block clients you don't like. The question is whether the connection needs to be secure, hence some kind of token exchange or you just want to prevent accidental damage. curl is very helpful if you want to test what a client an do with your server.

Michael Shopsin
  • 2,055
  • 2
  • 24
  • 43