#Regarding running grasscutter in a linux env (arch)
292 messages · Page 1 of 1 (latest)
firstly, id like to ask if its common for grasscutter to use port 443 instead of an internal port 
like everything uses https
Although the top line says port in use, the lower error is the real cause: permission denied. Depending on your environment you may just need to sudo start the server, or you may also instead change it off port 443 to something higher
Also yes grasscutter always binds to 443 for dispatch by default
ohh
yeah i think i might have to change the port to somethin else...
Yeah just edit config.json so that the bindPort for server is something else, probably not a common bind port would be better
if say i were to change the port from 443 to 6969, should i also sudo ufw allow 6969?
Yeah that would be a good idea
les gooooooooooooo
thank you!
also, i now remember cultivation used localhost:443 by default
so instead of 443, id now have to connect the game to localhost:6969 but like...
how do i start the game?

right now,
i have a working game installation using this:
https://github.com/an-anime-team/an-anime-game-launcher
im really sorry i have never run the game raw with grasscutter(without cultivation)

You just need mitmproxy which you can run from the grasscutter folder with mitmdump -s proxy.py -k (since proxy.py is there), you will want to make sure your system proxy is on, and you may need to do this as well #1030999313209380934 message
thanks for the link, ill look into it rn!
mitmproxy is also using port 443 by default
also, the proxy doesnt seem to work
welp,
also, what is this about tho?
what does "setting the http_proxy and https_proxy enviorment variables" mean?
is it this?
Ah right you'll need to edit proxy_config (in grasscutter folder) so that remote port is the same as the one your server is now hosting on. As for the environment variables, those should be for the system environment variables (you may just need to look up how to set those for your environment)
heya, i am not in arch right now but i yesterday i managed to run grasscutter in port 443(stopped the nginx.service) and then hit a hardblock while running mitmproxy
ill boot into arch later and try to document the current situation
didnt have to change the port since i got grasscutter running on 443
im able to access grasscutter from mongodb compass
but the proxy doesnt seem to be working
i have followed https://gist.github.com/franciscocpg/a4f52afcc00d472a9d7c407db16a92ee
and got the proxy's cert installed
The proxy not appearing to work is because your traffic isn't going through mitm, you'll need to do this #1030999313209380934 message
yes that seems to be the case
regarding this text:
#1030999313209380934 message
im not sure where and what variables to put
the arch documentation has info on setting those variables in the 'Proxy server ' page
https://wiki.archlinux.org/title/Proxy_server step 2 is the setting of environment variables
i see, ill search and try to troubleshoot
ohh thanks
export http_proxy=http://10.203.0.1:5187/ export https_proxy=$http_proxy export ftp_proxy=$http_proxy export rsync_proxy=$http_proxy
what must i set the http_proxy as? 
sorry this is my the first time ever dealing with proxies 
http://127.0.0.1:8080/ would be my best guess, though to be fair I haven't set the env variables in arch for proxy before
well what are you trying to access? 8080 is just where the proxy is listening at
yeah you access grasscutter on 443
if mitmdump is not running, i shouldve just got not reachable i assumed... (i might be gravely wrong)
your mitm should be good if you set the environment variables, I don't use mitm but on fiddler you would just get the loopback service if you went to localhost:8080
im pretty sure its a firefox problem?
can i just use fiddler instead?
you could but I'm pretty sure the traffic issue is due to arch itself (since the applications use the env settings for proxy) and not what proxy you use, though no harm in trying if you can
these are the variables ive set
yeah that should be good, have you tried logging in to the game with mitmdump and grasscutter running since you set that?
ill try my best getting mitmproxy working but if i cant, atleast i could try fiddler
no but...
this isnt going through the proxy
so the game shouldnt work right?
one of the url's from proxy.py
that may be the case, you might want to change the http_proxy to be http://localhost:8080/ instead in that case first, just to see
Though some domains are specifically blocked rather than redirected/accepted
such as data uploads
like this?
yeah
is your system proxy also on?
no only mitmdump is that system proxy? 
No I mean your actual system proxy settings, not sure where they're at in arch but should be in your network settings somewhere
i wasnt
also, i launched the game
and it connected to hoyo servers
installed gnome control center for now
got mitmproxy working
ill try launching the game
it auto logged into my burner account 
i got it working!!!!!!!!!!!!! all i had to add was these env variables in the anime launcher serttings
i got this error tho
i assume thats cuz of an unpached ua.dll
ill get back to you 
i did the thing!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
omfg
thank you soo much
@austere bison 
Glad it all worked out haha
for anyone from the future looking at this post, this is a bad idea and do not do this. it f***s up your entire network and i have removed those lines that ive added
this(gnome-control-center) is a better idea instead
this, gnome control center tweaks + adding mitm cert should be enough for mitmproxy+grasscutter to work
oh...you tried that already...did it work?\
yes
but like
itll work with basically any settings manager
even without one if you can craft the required command
i was using dwm and i downloaded the full gnome suite
to make my life easier
Yeah I known....but let's just say I haven't had great experiences with networking stuff
so.. if you require help with anything linux grasscutter related, how about making a new support post while referring to this ancient post so that the new one can be marked as completed. cuz there arent many support posts related to linux and the existent ones are an intertangled mess. 💀
yeah...that sounds better
Got the same error...with gnome proxy and the http_proxy variables too
what error? 
make sure you use http only. for both http_proxy and https_proxy too. else if you use https for https_proxy, ill be treated as if you are using encryption which afsik, shouldnt be using when you are locally hosting grasscutter.
you do indeed use encryption for local hosted grasscutter
only cultivation is the odd duckling that requires it disabled
cultivation doesn't use ssl for local connections iirc
ohh
so it has to be disabled server-side or you will always error
ssl issue
damn
if there's ever gonna be a cultivation binary for linux, i think it would be easy for the devs to implement ssl and let the encryption be enabled by default
that's something to do with cultivation's proxy being made for culti, whereas existing proxy programs (mitm, fiddler) do use it so the server has encryption enabled (thus encryption enabled being default for the server)
guess you gotta use https(since you are connecting to an external server)? i got no idea tbh
https is required for any external servers
is that how the proxy works though? seems awfully wrong but 
but i assumed cultivation was using mitm since you had to accept the installation of its root ca...
you only have to accept the root cert for cultivation, not mitm (unless you installed mitm)
that's what the cert popup in culti is at least, it's for "Cultivation"
like this?
but everytime i actually used https for https_proxy, i got that error which you get when you enable cultivation when connecting to local server
Port needs to be specified?
man I'm not sure how to tell you this but I'm 99% that is for your local system proxy
unless you want to try to send your entire system traffic to cherrymint (you won't be getting anything working)
your proxy should be 127.0.0.1 on 8080, then your proxy (which is listening on 8080) determines that the game traffic specifically is sent to cherrymint (on 443)
read from here down
you just need to send the game traffic to your proxy, which then sends it to the server specified instead of where it normally wants to go
**try this: **
for system proxy:
http_proxy http://127.0.0.1:8080/
https_proxy https://127.0.0.1:8080/
for an-anime-game-launcher:
http_proxy http://cherrymint.live/
https_proxy https://cherrymint.live/
ayo no...
it looks wrong
i assume this could maybe work since when i was locally hosting, i had my config like this:
for system proxy:
http_proxy http://127.0.0.1:8080/
https_proxy http://127.0.0.1:8080/
for an-anime-game-launcher:
http_proxy http://127.0.0.1:8080/
https_proxy http://127.0.0.1:8080/
but it just looks wrong
you were using mitm with that though right
looks right, the game traffic is sent to mitm which is listening at 127.0.0.1:8080 then mitm handles sending the traffic matching the script to the server and the rest is left alone to passthrough
i got the python file ready
ok set your http proxy like above and then change the remote host in proxy_config.py
what is this? It's called proxy config but that's not the actual proxy config file for grasscutter
also still you should have it set like this
here I just went ahead and edited it for you since you're having a hard time
wait a sec, @austere bison , localhost:8080 is mitm and localhost:443 is grasscutter right?
yes your proxy is on 8080, the server dispatch is on 443
you don't try to connect to the server on 8080
i think i get it now
your proxy config is set to 8080 because that's where the proxy is at
the proxy application on your system (such as mitm)
put the script above somewhere and then run mitmdump -s proxy.py -k where the file is, you may need to sudo
i dont think he needs to enable any system proxy.
i think this this worth a try:
in proxy_config.py:
REMOTE_HOST = "cherrymint.live"
REMOTE_PORT = 443
in the an-anime-game-launcher:
http_proxy http://127.0.0.1:8080/
https_proxy https://127.0.0.1:8080/
i wanna try the above mentioned method to properly test if it works but im running an upscale job since 2hrs and its gonna take another 4hrs to complete. cant test since i'd have to reboot into arch to do so...
#1025543438604710018
I get the feeling the error you get is here
perhaps at the very top of the list
try using https for https_proxy
also that
is the game even launching? when trying to login, what error is it outputting?
wrong hoyoverse id
sounds like your proxy isn't on
preciisely
ok cool but are you sending your traffic there
can't route the traffic if your traffic isn't going through it
that's what the env variables are for, pretty sure you need the system proxy on too though
there?
well the env variables are just telling the application where the proxy is, no?
no you have put the ports in the address box
just change both address boxes to localhost or 127.0.0.1
like in systemproxy, http_proxy = localhost & https_proxy = localhost
are you talking about trying to push all system traffic to mitm then mitm starting a server on 8080 and in the game launcher vars, putting localhost 8080?
in a normal setup that is exactly what happens
all traffic goes through the proxy, and the proxy script determines what passes through and what is redirected
yes thats why
so this basically? (askin cuz edited)
cuz if thats right in the theory part, its just a matter of implementing it through vars
all other apps are going throught the proxy
yes that is correct, then your game launcher needs the http_proxy and https_proxy variables set to send the game traffic there as well
looks like you haven't trusted the cert yet though
locahost:8080
@empty dome in your browser, try visiting http://mitm.it/ and take a screenshot
now that this is the case
try this, if it says proxy no work, then system proxy problem. if it shows a site with installation links for a cert, its either that you have yet to install their cert or that means your system proxy and mitm is working perfectly fine but the problem is with the the anime game launcher not receiving proxied traffic from mitm(which has cherrymint live as remote host).
ok...why i cant install now
ssl cert?
yeah
maybe you have it already installed
check the trusted ca's in your system settings
the directory in fedora was diferent
so you running gnome on fedora?
is that the error in the game?
try visiting localhost:8080 on your browser
perhaps a network error of the code 4214?
bad getaway
Welcome to Grasscutter!
should be visiting an mhy or genshin site
much easier than trying to go to the proxy host address
just try opening the genshin main site
it should look like this but with localhost:8080 in the address bar
ohh yes right... i forgor 💀
my bad
go to genshin site
hmmmm... try removing all of the http_proxy variables and just have the https_proxy variables only..?
in the laucher?
yea proxy no work, problem with system not being able to route traffic through mitm
system and launcher
nope
also, your launcher looks like the gtk version... so why do i have this smoolll feeling that its a bug with the gtk version of the anime game launcher? (since it worked for me using the stock aur version (i might be gravely wrong
))
well it looks like it isn't on so you'll want to make sure it is, just like back here when your traffic was going through it
i will change it...
i will be back
theres a migration process without reinstalling the game
ohh nooo...
also, have you confirmed that the private server was working when you were hosting gc locally?
Yeah...I will try again after my job is done...
Anyways if your want a REAL CHALLENGE try running grasscuters/joining private servers on Ubuntu touch lololol
Any possibility on potentially doing a writeup on how to get it working? Got a laptop with Linux installed, and I was considering doing some work on a MelonLoader plugin that I'm working on which seemingly requires a private server instance to work.
Use AAGL, there are newer threads with better info already, including one in the pinned thread
This one pretty much covers it though, use AAGL, get the game good to go with that, set up mitmproxy, set proxy in environment variables in AAGL, launch mitm with command line (see grasscutters github if you don't know), launch game. For running Grasscutter, download a full build from #resources, extract it, and start it
So I've set MangoDB up, alongside getting mitmproxy mostly working (more on that later), and getting Grasscutter working with a 44300 port (as 443 is taken by my web browser).
However, I'm having a bit of a problem with importing the needed SSL certificates for HTTPS URLs to connect properly. The mitmproxy site (mitm.it IIRC) shows up, it's just that the import instructions for the key doesn't seem to work with Fedora (Which I'm using instead of Ubuntu, which is seemingly what the instructions are geared towards). Also, if I have Steam open, mitmproxy refuses to start up, and I'm wondering if I can change the port of that somehow. mitmproxy launches, it just doesn't make the .py script needed to configure anything.
mitm isn't creating the .py script you need, it comes from the Grasscutter github (also included if you downloaded a full build), just to make sure we're on the same page
https://github.com/Grasscutters/Grasscutter
Just look up how to import root certs for Fedora, though I'm not familiar with it I'm sure the documentation has info for something so used
Okay. Thanks for the tip!
Sure thing
Yeah, my bad. I got that set up, and now when I enter in one of the URLs in the host in my web browser, it says "Welcome to Grasscutter". Now when I try and sign in, it doesn't let me agree to the Terms of Service.
nevermind about that last part
Got that fixed.
Anyways, I got it up and running now.
Okay, now that I actually log in, it's now giving me an error with the code 12-4301
Alright, yeah I used the anime game launcher. Restarting still gives me the error
Use new account, if it persists your game is corrupt, redownload
On it.
Same error with the freshly created account.
Okay, Time to redownload the game.
I did move over my game data files from the RPM repository of the anime game launcher, as I figured out the dependency issues with the flatpak. So that might have caused problems.
Although when I'm using the 3.7 GC resource files from YuukiPS, it's trying to claim the game server version is 3.6.
I remember trying to download the resource files from the grasscutter wiki, and made an account and such to try and access it, but it wouldn't budge
Resources have nothing to do with what version is displayed in the cmd, that's dependent on the jar
Yuuki resources are the correct ones to use
You're trying to use a 3.6 Grasscutter jar, so that's why that is displayed in the cmd
The 1.5.0 jar in the releases section?
If you're using the release on the github that is for 3.6 yes
It's the first line in the release notes changelog
If you want 3.7 then get the 3.7 commit build from actions or build from source
Any build from development branch after 3.7 commit will work too of course
Thanks. Now it shows up right.
Okay, redownloaded the game alongside updating the version of grasscutter, and it still prints out the same error code.
It gives me this in the logs for grasscutter:
20:40:06 <INFO:DefaultAuthenticators$SessionKeyAuthenticator> [Dispatch] Client [0:0:0:0:0:0:0:1] succeed to exchange combo token.```
Yeah, same error.
Tried making a new account.
Hiya, were you able to solved this issue?
No I don’t think so, will have to try again.
Okay, let me know
Are you using VPS or LAN?