space-wizards / SS14.Launcher

Launcher for Space Station 14.
https://spacestation14.io
MIT License
35 stars 62 forks source link

Launcher ignores paths in connection URI #49

Closed SarahGreyWolf closed 2 years ago

SarahGreyWolf commented 2 years ago

Hi I'm using a proxy to convert http to https aswell as allow for subdomains on the same server. I would like to be able to have it connect at space.domain.tech/play to perform the /info request. This would allow me to have space.domain.tech itself for information on the server and the current round. However when entering this into direct connect it removes the path and just attempts to connect to space.domain.tech:1212 or space.domain.tech:443 if using ss14s.

I have included the stack trace though it's just a generic "No such host is known" error.

[18:24:22 ERR] Failed to connect: ConnectionFailed
SS14.Launcher.Models.Connector+ConnectException: Failed to connect: ConnectionFailed
 ---> System.Net.Http.HttpRequestException: No such host is known. (space.domain.tech:1212)
 ---> System.Net.Sockets.SocketException (11001): No such host is known.
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token)
   at System.Net.Sockets.Socket.<ConnectAsync>g__WaitForConnectWithCancellation|277_0(AwaitableSocketAsyncEventArgs saea, ValueTask connectTask, CancellationToken cancellationToken)
   at SS14.Launcher.HappyEyeballsHttp.AttemptConnection(AddressFamily addressFamily, SocketsHttpConnectionContext context, CancellationToken cancellationToken) in /home/runner/work/SS14.Launcher/SS14.Launcher/SS14.Launcher/HappyEyeballsHttp.cs:line 93
   at SS14.Launcher.HappyEyeballsHttp.OnConnect(SocketsHttpConnectionContext context, CancellationToken cancellationToken) in /home/runner/work/SS14.Launcher/SS14.Launcher/SS14.Launcher/HappyEyeballsHttp.cs:line 76
   at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.AddHttp11ConnectionAsync(HttpRequestMessage request)
   at System.Threading.Tasks.TaskCompletionSourceWithCancellation`1.WaitWithCancellationAsync(CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.GetHttp11ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
   at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.DecompressionHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.GetStringAsyncCore(HttpRequestMessage request, CancellationToken cancellationToken)
   at SS14.Launcher.Models.Connector.GetServerInfoAsync(String address, CancellationToken cancel) in /home/runner/work/SS14.Launcher/SS14.Launcher/SS14.Launcher/Models/Connector.cs:line 212
   --- End of inner exception stack trace ---
   at SS14.Launcher.Models.Connector.GetServerInfoAsync(String address, CancellationToken cancel) in /home/runner/work/SS14.Launcher/SS14.Launcher/SS14.Launcher/Models/Connector.cs:line 227
   at SS14.Launcher.Models.Connector.ConnectInternalAsync(String address, CancellationToken cancel) in /home/runner/work/SS14.Launcher/SS14.Launcher/SS14.Launcher/Models/Connector.cs:line 76
   at SS14.Launcher.Models.Connector.Connect(String address, CancellationToken cancel) in /home/runner/work/SS14.Launcher/SS14.Launcher/SS14.Launcher/Models/Connector.cs:line 58
PJB3005 commented 2 years ago

Your domain (space.domain.tech) doesn't seem to exist, or at least I can't seem to resolve it.

However when entering this into direct connect it removes the path and just attempts to connect to space.domain.tech:1212 or space.domain.tech:443 if using ss14s.

That's because to send the HTTP request, it has to first connect a TCP socket to either space.domain.tech:1212 or space.domain.tech:443. It can't even connect to your server in the first place, so the query path (which is part of HTTP, not TCP) isn't even mentioned in the error message.

SarahGreyWolf commented 2 years ago

Sorry, I gave domain as an example really, but if you need it for testing it would be space.sarahgreywolf.tech and space.sarahgreywolf.tech/play

SarahGreyWolf commented 2 years ago

Unsure what I did but it seems to be mysteriously working now, as is the way of software I guess, thanks anyway, and thanks for the great project