0

I've been searching on Google and Stackoverflow but i couldn't find a way to do this. I have a proxy list (ip:port) which i want to use to open new connections.

This is my code which uses my network ip address:

static void Connect()
{
    try
    {
        TcpClient client = new TcpClient(IP, PORT);
    }
    catch (SocketException e)
    {
        Console.WriteLine(e);
    }
}

What do i want to achieve?

  • Opening a connection with a proxy from a list.

Question:

How can i change the ip address that TcpClient is using? Not the ip address from the server but the ip address from the client.

Thanks in advance

J. Adam
  • 1,457
  • 3
  • 20
  • 38
  • *"How can i change the ip address that TcpClient is using? Not the ip address from the server but the ip address from the client."* - You cannot locally change the IP address to some external one. If you connect through a proxy the server will implicitly see the proxy as source IP though and not your original source IP. – Steffen Ullrich Oct 19 '19 at 12:28
  • Possible duplicate of [C# TcpClient.Connect via a proxy](https://stackoverflow.com/questions/18289418/c-sharp-tcpclient-connect-via-a-proxy), [Communicating with an HTTP Proxy via a .NET TcpClient](https://stackoverflow.com/questions/691550/communicating-with-an-http-proxy-via-a-net-tcpclient). – Steffen Ullrich Oct 19 '19 at 12:30

0 Answers0