This listens on my first network, 192.168.1.150, which is fine for now.
\nBut how can I make the proxy redirect traffic to the second network, 10.1.100.10? Is it possible to specify the network interface in some way?
\nI made a small diagram:
\n| User uses a proxy | -------> | Proxy input on 192.168.1.150:8899 | \n |\n |\n |\n |\n| Response to the user | <------- | Proxy redirects traffic to 10.1.100.10 | \n
I've tried looking into the source code, and I think my answers lie in 'proxy/core/connection'. However, I'm having trouble figuring out how to use them with override or via a plugin.
\nDoes anyone have any ideas on how to achieve this ?
","upvoteCount":1,"answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"The response:
\nYou needed to set the port to '0' so that the machine could choose a random port. Otherwise, multiple sockets would be created with the specified port, causing an error!
\ndef resolve_dns(self, host: str, port: int) -> Tuple[Optional[str], Optional['HostPort']]:\n return None, (\"192.168.1.150\", 0)\n
-
I have two distinct local networks, 192.168.1.0/24 and 10.1.100.0/24. Let's say I run a proxy like this: if __name__ == '__main__':
proxy.main(
hostname="192.168.1.150",
port=8899
) This listens on my first network, 192.168.1.150, which is fine for now. But how can I make the proxy redirect traffic to the second network, 10.1.100.10? Is it possible to specify the network interface in some way? I made a small diagram:
I've tried looking into the source code, and I think my answers lie in 'proxy/core/connection'. However, I'm having trouble figuring out how to use them with override or via a plugin. Does anyone have any ideas on how to achieve this ? |
Beta Was this translation helpful? Give feedback.
-
@LoickZoty What do you mean by redirect traffic to 2nd network? Your code listening on |
Beta Was this translation helpful? Give feedback.
The response:
You needed to set the port to '0' so that the machine could choose a random port. Otherwise, multiple sockets would be created with the specified port, causing an error!