Hello fellow Hackforums members.
I am looking for a way to connect to a tcp server (minecraft server in the current case) with a proxy.
Is there something like HttpWebRequest.Proxy for sockets? (HttpWebRequest example below)
Example of a socket class that needs connect to a server trough a proxy:
I have heard about SOCKS5, but i'm not sure if it the right way to get sockets connect trough a proxy.
I am looking for a way to connect to a tcp server (minecraft server in the current case) with a proxy.
Is there something like HttpWebRequest.Proxy for sockets? (HttpWebRequest example below)
PHP Code
<?php
HttpWebRequest httpRquest = (HttpWebRequest)WebRequest.Create("random website");
httpRquest.Proxy = new WebProxy("proxy address");
Example of a socket class that needs connect to a server trough a proxy:
PHP Code
<?php
class HFLookingForHelp
{
static Socket mainSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
static byte[] buffer = new byte[1028];
static void Main(string[] args)
{
//mc.Koridorius.lt = server ip (minecraft server), 25565 = port of the minecraft server
ConnectToServer("mc.Koridorius.lt", 25565);
}
static void ConnectToServer(string ip, int port)
{
mainSocket.BeginConnect(ip, port, new AsyncCallback(OnConnectedToServer), null);
}
static void OnConnectedToServer(IAsyncResult ar)
{
Console.WriteLine("Connected to server.");
//Connected, begin reicing/sending bytes
}
}
I have heard about SOCKS5, but i'm not sure if it the right way to get sockets connect trough a proxy.


![[Image: bjAHpdw.png]](https://i.imgur.com/bjAHpdw.png)