Connecting to the proxy server.
so.
i was making a thing so i could connect to the proxy server.
i swear to god if anyone says "just use krelay" ill fkin do something
So proxy server connects to 127.0.0.1 2050.
When you listen on that port, you get no errors. But the game does not start. Why? Because the game tries to send packets to the server to connect.
Right now the game is trying to connect to local 2050, but local 2050 only listens on that port, it doesnt do anything.
So I started making a program. At start it listens on 127.0.0.1 port 2050
Then it receives all packets send there. Like the hello packet the game tries to send to the server.
So I would need to send that hello packet to the server right? Because thats what the game tries to do if you're not connected to the proxy server.
The game tries to send packets to the server, the server responds with its own packet, the game sees it and sends more etc..
So I would think that if I made something that forwards the packets from the game to the server, I could then receive any responses and send them to the 127.0.0.1 2050.
However look at my code.
Especially this piece
When the hello packet is send, I dont receive any response from the server. Which is weird.
I think it could be from the encoding, the server doesnt understand it? idk.
Help is appreciated.
i was making a thing so i could connect to the proxy server.
i swear to god if anyone says "just use krelay" ill fkin do something
So proxy server connects to 127.0.0.1 2050.
When you listen on that port, you get no errors. But the game does not start. Why? Because the game tries to send packets to the server to connect.
Right now the game is trying to connect to local 2050, but local 2050 only listens on that port, it doesnt do anything.
So I started making a program. At start it listens on 127.0.0.1 port 2050
Then it receives all packets send there. Like the hello packet the game tries to send to the server.
So I would need to send that hello packet to the server right? Because thats what the game tries to do if you're not connected to the proxy server.
The game tries to send packets to the server, the server responds with its own packet, the game sees it and sends more etc..
So I would think that if I made something that forwards the packets from the game to the server, I could then receive any responses and send them to the 127.0.0.1 2050.
However look at my code.
Code:
Imports System.Net.Sockets
Imports System.Net
Module Module1
Dim listener As TcpListener = New TcpListener(IPAddress.Parse("127.0.0.1"), 2050)
Dim textz As String
Dim texts As String 'the one server sent
Dim clientsendpacket As Boolean = False
Dim serversendpacket As Boolean = False
Sub Main()
getfrom()
Console.ReadLine()
End Sub
Sub sendto()
Dim txp As TcpClient = New TcpClient
txp.Connect("52.77.221.237", 2050)
Console.WriteLine("> Connected to Game Server")
Using ns As NetworkStream = txp.GetStream
While True
Do Until clientsendpacket = True
Loop
Try
Dim msg As Byte() = System.Text.Encoding.ASCII.GetBytes(textz)
ns.Write(msg, 0, msg.Length)
Console.WriteLine("> Packet send to Game Server")
clientsendpacket = False
Catch ex As Exception
Console.WriteLine("DAMN IT FUCK SHIT")
MsgBox(ex.ToString)
End Try
Dim receive(255) As Byte
Dim length As Integer = ns.Read(receive, 0, receive.Length)
texts = System.Text.Encoding.ASCII.GetString(receive, 0, length)
Console.WriteLine(texts.Length.ToString)
serversendpacket = True
End While
End Using
End Sub
Sub getfrom()
listener.Start()
Console.WriteLine("Listening on 127.0.0.1, port 2050.")
Dim tcp As TcpClient = listener.AcceptTcpClient
Using ns As NetworkStream = tcp.GetStream
If True Then
Console.WriteLine("> Client connected to local")
End If
While True
Try
Dim receive(255) As Byte
Dim length As Integer = ns.Read(receive, 0, receive.Length)
textz = System.Text.Encoding.ASCII.GetString(receive, 0, length)
Console.WriteLine("> Packet received from client")
clientsendpacket = True
Catch ex As Exception
Console.WriteLine("WTF?")
MsgBox(ex.ToString)
Return
End Try
'Forward to server
Try
sendto()
Catch ex As Exception
Console.WriteLine(ex.ToString)
End Try
Do Until serversendpacket = True
Loop
Dim msg As Byte() = System.Text.Encoding.ASCII.GetBytes(texts)
ns.Write(msg, 0, msg.Length)
serversendpacket = False
End While
End Using
End Sub
End Module
Code:
Dim receive(255) As Byte
Dim length As Integer = ns.Read(receive, 0, receive.Length)
texts = System.Text.Encoding.ASCII.GetString(receive, 0, length)
I think it could be from the encoding, the server doesnt understand it? idk.
Help is appreciated.

