moonlight-stream / moonlight-chrome

GameStream client for ChromeOS
GNU General Public License v3.0
734 stars 162 forks source link

Establish connection via ssh tunnel #407

Open matthiasreisser opened 6 years ago

matthiasreisser commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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[bot] commented 6 years ago

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

apoklyps3 commented 2 years ago

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 commented 2 years ago

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 commented 3 months ago

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 }}