0

Is there any way to forward incoming traffic to specific TLD/App by the requested port only on local network level ?

To be more specific, I'll try give an example.

For Example: My machine has 192.168.0.100 IP And I can access apps like-so: http://app-1.dev http://app-2.dev etc...

My phone has 192.168.0.101 IP And I want to access app-1.dev on the 192.168.0.100

So is there any way to redirect traffic like this ?:

Request (from: phone/192.168.0.101) 192.168.0.100:3001 -> http://app-1.dev Request (from: phone/192.168.0.101) 192.168.0.100:3002 -> http://app-2.dev

  • This is unclear. On which device do you want to do the redirection and to where? I have the impression that you're looking for a DNS solution but I'm unsure. – Julie Pelletier Jul 1 '17 at 18:17
1

Take a look at socat. It's a tool that establishes two bidirectional byte streams and transfers data between them.

Syntax:

socat TCP4-LISTEN:3001,fork TCP4:www.targetwebsite.com:8080

Where connections on port 3001 are directed to targetwebsite.com on port 8080

  • It's kind of working, but caddy/nginx can't handle the request to 192.168.0.100:3001 and shows 404. Im going to dig in deeper and try more – Eimantas Gabrielius Jul 2 '17 at 9:21
  • 1
    @EimantasGabrielius: I was expecting that. You won't be able to do it that way. You need some sort of DNS solution but to define how it can be established, you need to clarify your setup. – Julie Pelletier Jul 3 '17 at 15:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.