Skip to content
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

Self host server #58

Closed
rsurgiewicz opened this issue Nov 9, 2021 · 5 comments
Closed

Self host server #58

rsurgiewicz opened this issue Nov 9, 2021 · 5 comments

Comments

@rsurgiewicz
Copy link

Hi there,

I'm currently having a look at your solution.
Seems to be a great alternative to localtunnel or ngrok.

I'm missing any info/steps how to actually deploy self hosted service?

I do have a devops skills, I'd like to run it later on as a docker container (can share files with you), but first I need to understand how to deploy and use it as self hosted solution.

Thank you!

@azimjohn
Copy link
Owner

azimjohn commented Nov 9, 2021

Hello,

You can separately deploy HTTP and TCP proxy servers by compiling the following code:

Once you have the binaries, you can run them and expose the server.
Domain DNS settings and Nginx configurations can be found in this discussion/issue:

Let me know if you need any additional info.

@rsurgiewicz
Copy link
Author

rsurgiewicz commented Nov 10, 2021

Hi @azimjohn
Thanks a lot for the info the last link was helpful.
My Dockerfile looks like this right now

FROM golang:1.15.0-buster

WORKDIR /tunnel
COPY . .
RUN go mod download
RUN go build ./jprq_cli/tcp_server/main.go
EXPOSE 4500
CMD ["./main"]

so i have jprq and nginx containers running there with configuration suggested here (azimjohn/jprq-python-client#1).

I am able to run the python-client

python -m jprq tcp 8000 --host myhost.domain.com

jprq : 2.0.1                                        Press Ctrl+C to quit.

Tunnel Status            Online
Forwarded                myhost.domain.com:39331 → 127.0.0.1:8000

Which is a good sign :)
But I don't see (or maybe I don't understand), how external request can hit eg myhost.domain.com:39331 as this port is not exposed anywhere.
Like, shall I expose some port range?

Thanks a lot!

@azimjohn
Copy link
Owner

@rsurgiewicz Great progress so far!

Yes, you would need to expose ports between 1024-65535 (all unprivileged ports).

@rsurgiewicz
Copy link
Author

Any ideas for the docker container except using network_mode:host that I'd like to avoid ?
As we all know docker will all RAM memory when exposing a big range of ports.

@azimjohn
Copy link
Owner

azimjohn commented Jan 1, 2022

Checkout https://github.com/robinvandernoord/jprq-server-deploy

Thank you @robinvandernoord for putting them all together!

@azimjohn azimjohn closed this as completed Jan 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants