Skip to content

Commit

Permalink
Use different port for websocket connection
Browse files Browse the repository at this point in the history
  • Loading branch information
trippyone committed Jun 9, 2024
1 parent c4d2802 commit 94725a5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Fika.Core/Networking/FikaServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public async Task Init()
};

var natPunchServer = new FikaNatPunchServer(_netServer);
natPunchServer.Listen();
natPunchServer.Connect();

if (FikaPlugin.UseUPnP.Value)
{
Expand Down
2 changes: 1 addition & 1 deletion Fika.Core/Networking/NatPunch/FikaNatPunchClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class FikaNatPunchClient
public FikaNatPunchClient()
{
// Assuming http protocol is always used
Host = RequestHandler.Host.Replace("http", "ws");
Host = $"{RequestHandler.Host.Replace("http", "ws").Split(':')[0]}:6970";
SessionId = RequestHandler.SessionId;
Url = $"{Host}/{SessionId}?";

Expand Down
4 changes: 2 additions & 2 deletions Fika.Core/Networking/NatPunch/FikaNatPunchServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class FikaNatPunchServer
public FikaNatPunchServer(NetManager netManager)
{
// Assuming http protocol is always used
Host = RequestHandler.Host.Replace("http", "ws");
Host = $"{RequestHandler.Host.Replace("http", "ws").Split(':')[0]}:6970";
SessionId = RequestHandler.SessionId;
Url = $"{Host}/{SessionId}?";

Expand All @@ -41,7 +41,7 @@ public FikaNatPunchServer(NetManager netManager)
StunIpEndPoint = NatPunchUtils.CreateStunEndPoint(FikaPlugin.UDPPort.Value);
}

public void Listen()
public void Connect()
{
_webSocket.Connect();
}
Expand Down

0 comments on commit 94725a5

Please sign in to comment.