ZTzTopia / GTProxy

⚖️ A proxy for growtopia. NO SHADOW BAN!
MIT License
57 stars 38 forks source link

proxy usage #82

Closed realyukii closed 5 months ago

realyukii commented 5 months ago

I tried to connect my growtopia client (android) to the proxy that run on my linux machine on the same network. I need to adjust the server address on the http response to make it work. The client successfully connected to the enet server, but it just stuck there. here's the log:

$ sudo ./Proxy
[2024-05-28 08:56:58.895] [GTProxy] [info] Starting GTProxy (v2.0.0)
[2024-05-28 08:56:58.895] [GTProxy] [info] Loading config file "config.json"...
[2024-05-28 08:56:59.145] [GTProxy] [info] Config file "config.json" is all loaded up and ready to go!
[2024-05-28 08:56:59.145] [GTProxy] [info] The server is up and running with port 16999 and 1 peers can join!
[2024-05-28 08:56:59.145] [GTProxy] [info] The client is ready to connect to the server!
[2024-05-28 08:56:59.146] [GTProxy] [debug] Checking if extension with UID 0x153bd697 should be ignored
[2024-05-28 08:56:59.146] [GTProxy] [debug] Checking if extension with UID 0x4ea75473 should be ignored
[2024-05-28 08:56:59.146] [GTProxy] [debug] Checking if extension with UID 0xe9266491 should be ignored
[2024-05-28 08:56:59.146] [GTProxy] [info] HTTP(s) server listening on port 443.
[2024-05-28 08:58:34.808] [GTProxy] [info] Headers:
[2024-05-28 08:58:34.808] [GTProxy] [info]      Accept: */*
[2024-05-28 08:58:34.808] [GTProxy] [info]      Content-Length: 36
[2024-05-28 08:58:34.808] [GTProxy] [info]      Content-Type: application/x-www-form-urlencoded
[2024-05-28 08:58:34.808] [GTProxy] [info]      Host: www.growtopia1.com
[2024-05-28 08:58:34.808] [GTProxy] [info]      LOCAL_ADDR: 192.168.18.53
[2024-05-28 08:58:34.808] [GTProxy] [info]      LOCAL_PORT: 443
[2024-05-28 08:58:34.808] [GTProxy] [info]      REMOTE_ADDR: 192.168.18.84
[2024-05-28 08:58:34.808] [GTProxy] [info]      REMOTE_PORT: 50896
[2024-05-28 08:58:34.808] [GTProxy] [info]      User-Agent: UbiServices_SDK_2022.Release.9_ANDROID64_static
[2024-05-28 08:58:34.808] [GTProxy] [info] Params:
[2024-05-28 08:58:34.808] [GTProxy] [info]      platform=4&protocol=207&version=4.57
[2024-05-28 08:58:34.808] [GTProxy] [info] Body:
[2024-05-28 08:58:34.808] [GTProxy] [info]      version=4.57&platform=4&protocol=207
[2024-05-28 08:58:36.193] [GTProxy] [info] POST /growtopia/server_data.php 200
[2024-05-28 08:58:36.328] [GTProxy] [info] The server just got a new connection from the address 192.168.18.84:47959!
[2024-05-28 09:13:33.103] [GTProxy] [info] The server just lost a connection from the address 192.168.18.84:47959!

no error is shown in the log, any thoughts on how to debug? I will provide any additional information if needed.

ZTzTopia commented 5 months ago

It looks like the proxy won't connect to the Growtopia server. Maybe you can check the body content of server_data.php before being modified if the server ip and port are correct?

realyukii commented 5 months ago

I did check the response before it was modified, and indeed it's the correct server ip (213.179.209.168); however, I suspect the issue is related to forwarding packets.

A simplified program was created to isolate the problem. This program successfully prints packets, yet the Growtopia client fails to receive the essential "hello" packet from the Growtopia server. This leads to the conclusion that the initialized ENet client is unable to properly forward packets to the Growtopia client.

Unfortunately, I'm not too familiar with ENet, so I have no idea how it actually works. If you don't mind, please review the code.

EDIT: I think it too much, but now it's fixed.