refactor: remove SSL configuration from sdk_server

This commit is contained in:
Naruse
2024-11-09 14:26:09 +08:00
parent 4b9a4e171e
commit 0d11322ce9
3 changed files with 5 additions and 30 deletions

View File

@@ -36,26 +36,11 @@ Download resources & proto from [MikuBH3-Res](https://github.com/MikuLeaks/MikuB
│ └───__init__.py │ └───__init__.py
``` ```
## Connecting with the client (Fiddler method) ## Connecting with the client (Sparkle Proxy)
- Log in with the client to an official server at least once to download game data. - Download proxy from [Releases](https://github.com/MikuLeaks/MikuBH3-PS/releases)
- Install and have [Fiddler Classic](https://www.telerik.com/fiddler) running. - Extract the `Proxy.zip` file anywhere you want.
- Copy and paste the following code into the Fiddlerscript tab of Fiddler Classic. Remember to save the fiddler script after you copy and paste it: - Run `Sparkle-Proxy.exe` as administrator and open the game.
```
import System;
import System.Windows.Forms;
import Fiddler;
import System.Text.RegularExpressions;
class Handlers
{
static function OnBeforeRequest(oS: Session) {
if( (oS.host.EndsWith("global1.bh3.com")) || oS.host == "47.74.175.126" || oS.host.EndsWith(".yuanshen.com") || oS.host.EndsWith(".hoyoverse.com") || oS.host.EndsWith(".starrails.com") || oS.host.EndsWith(".bhsr.com") || oS.host.EndsWith(".kurogame.com") || oS.host.EndsWith(".zenlesszonezero.com") || oS.host.EndsWith(".g3.proletariat.com") || oS.host.EndsWith("west.honkaiimpact3.com") || oS.host.EndsWith("westglobal01.honkaiimpact3.com") || oS.host.EndsWith(".os.honkaiimpact3.com") || oS.host.EndsWith("overseas01-appsflyer-report.honkaiimpact3.com") || oS.host.EndsWith(".mihoyo.com") || (oS.host.EndsWith("global2.bh3.com") && !oS.host.Contains("bundle"))) {
oS.host = "127.0.0.1";
}
}
}
```
## Connecting with the client (DLL method) ## Connecting with the client (DLL method)

5
hi3
View File

@@ -1,5 +1,5 @@
import threading import threading
from sdk_server import HandleSdkServer, HandleSslSdkServer from sdk_server import HandleSdkServer
from game_server import GameServer from game_server import GameServer
from utils.config import Config from utils.config import Config
@@ -7,10 +7,7 @@ SdkThread = threading.Thread(
target=HandleSdkServer, target=HandleSdkServer,
args=(Config.GameServer.IP, Config.GameServer.Port, Config.SDKServer.Port), args=(Config.GameServer.IP, Config.GameServer.Port, Config.SDKServer.Port),
) )
SdkThreadSsl = threading.Thread(target=HandleSslSdkServer)
SdkThread.start() SdkThread.start()
SdkThreadSsl.start()
gameserver = GameServer() gameserver = GameServer()
GameThread = threading.Thread( GameThread = threading.Thread(

View File

@@ -73,10 +73,3 @@ def HandleSdkServer(ServerIp, GameServerPort, SdkServerPort):
Info(f"HTTP server started on port {SdkServerPort}") Info(f"HTTP server started on port {SdkServerPort}")
app.run(host=ServerIp, port=SdkServerPort) app.run(host=ServerIp, port=SdkServerPort)
def HandleSslSdkServer():
log = logging.getLogger("werkzeug")
log.setLevel(logging.ERROR)
Info("HTTPS server started on port 443")
app.run(host="127.0.0.1", port=443, ssl_context="adhoc")