-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spawn multiple gost instances in a single command with -- #713
base: master
Are you sure you want to change the base?
Conversation
@caribpa 这似乎看起来是多余的。 |
@guqing637 sorry, I don't understand Chinese but I'm going to reply assuming Google Translate did a good job translating your comment:
This PR adds the convenience of starting (and ending) independent gost instances in just one command, which is currently not possible unless you use different terminals (or use the background in Unix platforms). Please refer to the examples in the OP for further clarification or show me the commands that can currently achieve the same results without using different terminals/processes/Unix-background 🦺 |
@caribpa I believe this is useful to me, did you add this future in your forked code ?if so I wanna use your fork before upstream author decide to accept the pull |
Hi @lovitus! Yes, this feature is fully implemented in my fork and I use it myself. You can clone my fork and build it in order to use this useful feature :) git clone -b cmd-split https://github.com/caribpa/gost.git
cd gost/cmd/gost
go build Cheers! 🤸♀️ |
bcfb70c
to
0b3df2d
Compare
i agree |
Hi,
Congratulations for this amazing tool 💯! It is my go-to whenever I need to create tunnels 🎉
Due to the fact I use socks over reverse-tunnels a lot, this PR allows a single gost command to perform multiple operations in separated instances.
This is easier to explain with a short example:
Before this PR this is what you had to do if you wanted to create a socks over reverse-SSH:
After this PR the client no longer needs to use multiple terminals/processes:
This works by spawning a different gost instance in a goroutine with each
--
, so there are no configuration conflicts ✨!You can certainly use multiple
--
to do all sort of craziness in a single gost command:Of course, some things could be improved as I didn't alter the main logic of gost which relies on the globals gost.DefaultTLSConfig, gost.Debug, and gost.SetLogger(). Among them,
gost.DefaultTLSConfig
is the most "damaging" one as it means that all the gost instances spawned with--
will use the same TLS certificate (which won't happen if multiple gost processes are separately run in different terminals/processes instead of using--
).For sure, there are several ways of isolating
gost.DefaultTLSConfig
(and the other globals) per instance, but changes outside the scope of this simple PR are needed and, for my usage purposes, a shared TLS cert (or global debug/log) is perfectly fine 🕺Finally, the README.md will need to be updated to include my README_en.md changes as I don't understand Chinese, unfortunately 😅