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

Establish connection via ssh tunnel #407

Open
matthiasreisser opened this issue Feb 17, 2018 · 8 comments
Open

Establish connection via ssh tunnel #407

matthiasreisser opened this issue Feb 17, 2018 · 8 comments

Comments

@matthiasreisser
Copy link

Hey,
I find myself in a network where I cannot configure port forwarding on the router. Would it be possible to set up moonlight to use port forwarding through ssh? Given weak encryption, would the performance suffer significantly?

It would be interesting if anyone attempted this and could share experiences.

Mat

@cgutman
Copy link
Member

cgutman commented Feb 18, 2018

I'd go for an OpenVPN setup (over UDP) if you can. It will perform better than trying to forward Moonlight's data over a TCP-based SSH session.

@apoklyps3
Copy link

Thanks cgutman. Saved my life today with this ideea. Was struggling at work to play over wifi with alot of stuttering and slowdowns since on ethernet most ports are blocked and I saw this post.
OpenVPN is no piece of cake to configure , both as server and client. Took me about 2 hours, but once I got it going I was able to run moonlight on my former "blocked-LAN" with no stuttering or hiccup at all.

@matthiasreisser
Copy link
Author

Unfortunately port 22 is the only one accessible to me. If moonlight actually relies on UDP (I think it does?), I'd have to forward those too.
Is that a dealbreaker for moonlight? Thx @cgutman

@lecler-i
Copy link

lecler-i commented Feb 27, 2018

Yes you can use it by forwarding your ports !

You can do it via SSH or...
I personally use https://github.com/fatedier/frp/ because it is super easy to use.

Run the frps (serveur) with default config on your computer, and a client with following config on your box with gameStream :

[common]
server_addr = IPOFYOURCOMPUTER
server_port = 7000
 
[gamestream_tcp_47984]
type=tcp
local_ip=127.0.0.1
local_port=47984
remote_port=47984
 
[gamestream_tcp_47989]
type=tcp
local_ip=127.0.0.1
local_port=47989
remote_port=47989
 
[gamestream_tcp_48010]
type=tcp
local_ip=127.0.0.1
local_port=48010
remote_port=48010
 
[range:gamestream_udp]
type = udp
local_ip = 127.0.0.1
local_port = 47998-48010,48011
remote_port = 47998-48010,48011
 
[gamestream_udp]
type=udp
local_ip=127.0.0.1
local_port=5353
remote_port=5353

If your computer (with the client) is behind a NAT too and you can't forward port 7000, setup the server on a VM or whatever in a datacenter nearby and use it as a middle man...

@stale
Copy link

stale bot commented Jul 30, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale This isssue is stale/not updated label Jul 30, 2018
@stale stale bot removed the stale This isssue is stale/not updated label Jul 30, 2018
@apoklyps3
Copy link

Yes you can use it by forwarding your ports !

You can do it via SSH or... I personally use https://github.com/fatedier/frp/ because it is super easy to use.

Run the frps (serveur) with default config on your computer, and a client with following config on your box with gameStream :

[common]
server_addr = IPOFYOURCOMPUTER
server_port = 7000
 
[gamestream_tcp_47984]
type=tcp
local_ip=127.0.0.1
local_port=47984
remote_port=47984
 
[gamestream_tcp_47989]
type=tcp
local_ip=127.0.0.1
local_port=47989
remote_port=47989
 
[gamestream_tcp_48010]
type=tcp
local_ip=127.0.0.1
local_port=48010
remote_port=48010
 
[range:gamestream_udp]
type = udp
local_ip = 127.0.0.1
local_port = 47998-48010,48011
remote_port = 47998-48010,48011
 
[gamestream_udp]
type=udp
local_ip=127.0.0.1
local_port=5353
remote_port=5353

If your computer (with the client) is behind a NAT too and you can't forward port 7000, setup the server on a VM or whatever in a datacenter nearby and use it as a middle man...

I don't have access to the "blocked client" now to test this, but tell me if got this right. is 7000 de port which the client use to communicate with the server to forward all the "blocked" ports data and could this port be something else (ex 1196) ?

@apoklyps3
Copy link

Yes you can use it by forwarding your ports !

You can do it via SSH or... I personally use https://github.com/fatedier/frp/ because it is super easy to use.

Run the frps (serveur) with default config on your computer, and a client with following config on your box with gameStream :

[common]
server_addr = IPOFYOURCOMPUTER
server_port = 7000
 
[gamestream_tcp_47984]
type=tcp
local_ip=127.0.0.1
local_port=47984
remote_port=47984
 
[gamestream_tcp_47989]
type=tcp
local_ip=127.0.0.1
local_port=47989
remote_port=47989
 
[gamestream_tcp_48010]
type=tcp
local_ip=127.0.0.1
local_port=48010
remote_port=48010
 
[range:gamestream_udp]
type = udp
local_ip = 127.0.0.1
local_port = 47998-48010,48011
remote_port = 47998-48010,48011
 
[gamestream_udp]
type=udp
local_ip=127.0.0.1
local_port=5353
remote_port=5353

If your computer (with the client) is behind a NAT too and you can't forward port 7000, setup the server on a VM or whatever in a datacenter nearby and use it as a middle man...

tested your confing. sad to say it doesn't work. keep getting errors about port 5353 not being accessible

@Josefiks
Copy link

I've updated FRP client (frpc.toml) for you guys. Just set serverAddr and localIP 😘

serverAddr = "Your host IP with FRPS running"
serverPort = 7000

[[proxies]]
name = "SUNSHINE-HTTP"
type = "tcp"
localIP = "192.168.0.100"
localPort = 47989
remotePort = 47989

[[proxies]]
name = "SUNSHINE-HTTPS"
type = "tcp"
localIP = "192.168.0.100"
localPort = 47984
remotePort = 47984

[[proxies]]
name = "SUNSHINE-WEB"
type = "tcp"
localIP = "192.168.0.100"
localPort = 47990
remotePort = 47990

[[proxies]]
name = "SUNSHINE-RTSP"
type = "tcp"
localIP = "192.168.0.100"
localPort = 48010
remotePort = 48010

{{- range $_, $v := parseNumberRangePair "47998-48011" "47998-48011" }}
[[proxies]]
name = "SUNSHINE-{{ $v.First }}"
type = "udp"
localIP = "192.168.0.100"
localPort = {{ $v.First }}
remotePort = {{ $v.Second }}
{{- end }}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants