Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Patches/SendRequestPatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ private static void Prefix(ref HTTPRequest request)
var host = request.Uri.Host;
if (host == OfficialNameServer)
{
// Redirect the nameserver lookup to the custom server, swapping only the host.
var newHost = new System.Uri(Plugin.ServerHostname.Value).Host;
var builder = new Il2CppSystem.UriBuilder(request.Uri) { Host = newHost };
// Redirect the nameserver lookup to the custom server.
var newUri = new System.Uri(Plugin.ServerHostname.Value);
var builder = new Il2CppSystem.UriBuilder(request.Uri) { Host = newUri.Host, Port = newUri.Port };
request.Uri = builder.Uri;

if (debug)
Plugin.Log.LogInfo($"[HTTP] intercepted {host} -> {newHost}");
Plugin.Log.LogInfo($"[HTTP] intercepted {host}:{request.Uri.Port} -> {newUri.Host}:{newUri.Port}");
}

if (debug)
Expand Down