Skip to content

Commit 942be72

Browse files
fishiateeMelledy
authored andcommitted
feat: introduce mitmproxy
1 parent 574cbb3 commit 942be72

3 files changed

Lines changed: 42 additions & 1 deletion

File tree

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,21 @@ You may need to change the data version when switching regions. The `customDataV
5151
3. Download the `bin`, `language` folders from a repository with [datamined game data](https://github.com/Hiro420/StellaSoraData) and place them into your resources folder.
5252
4. Run the server with `java -jar Nebula.jar` from your system terminal. This server comes with a built-in internal MongoDB server for its database, so no Mongodb installation is required. However, it is highly recommended to install Mongodb anyway.
5353

54-
### Connecting with the client (Fiddler method)
54+
### Connecting with the client
55+
You can do this either via [mitmproxy](https://www.mitmproxy.org/) or [Fiddler Classic](https://www.telerik.com/fiddler/fiddler-classic).
56+
57+
#### Using mitmproxy (recommended)
58+
> [!IMPORTANT]
59+
> If you intend to connect using clients other than global, you may need to modify `mitmproxy/proxy.py` to also redirect their appropriate endpoints as well.
60+
61+
1. Download and install mitmproxy from [here](https://www.mitmproxy.org/) (do **NOT** get the Microsoft Store version)
62+
2. Navigate to the `mitmproxy` directory and run `proxy.bat`
63+
3. Navigate to `%userprofile%\.mitmproxy` and import `mitmproxy-ca-cert.cer` to **Local Machine**, place it under the **Trusted Root Certification Authorities** certificate store
64+
4. You may now launch the game
65+
66+
If Nebula is exposed on another port other than `80`, open `mitmproxy/proxy.py` with your favorite text editor and modify the `SERVER_PORT` field to the appropriate port.
67+
68+
#### Using Fiddler Classic
5569
1. **Log in with the client to an official server at least once to download game data.**
5670
2. Install and have [Fiddler Classic](https://www.telerik.com/fiddler) running.
5771
3. 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:

mitmproxy/proxy.bat

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
@echo off
2+
3+
REM -- We utilize mitmproxy's local redirector mode to *only* proxy Stella Sora.
4+
REM -- https://www.mitmproxy.org/posts/local-capture/windows/
5+
mitmweb -k -m wireguard --set stream_large_bodies=3m --set block_global=false --mode local:StellaSora.exe -s proxy.py
6+
7+
pause >nul

mitmproxy/proxy.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
from mitmproxy import ctx, http
2+
from mitmproxy.proxy import layer
3+
4+
# If you use any client other than the global client,
5+
# add their appropriate endpoints here (SDK and server)
6+
TARGET_HOSTS = [
7+
"en-sdk-api.yostarplat.com",
8+
"nova.stellasora.global",
9+
]
10+
11+
# Nebula server address
12+
SERVER_HOST = "127.0.0.1"
13+
SERVER_PORT = 80 # Make sure to modify this according to your config.json file!
14+
15+
def request(flow: http.HTTPFlow) -> None:
16+
if flow.request.pretty_host in TARGET_HOSTS:
17+
flow.request.scheme = 'http'
18+
flow.request.host = SERVER_HOST
19+
flow.request.port = SERVER_PORT
20+
return

0 commit comments

Comments
 (0)