mirror of
https://github.com/ppy/osu
synced 2025-01-31 18:32:14 +00:00
Merge pull request #17902 from peppy/signalr-proxy
Specify web proxy in SignalR connection building
This commit is contained in:
commit
0b82e3af27
@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Net;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.AspNetCore.SignalR.Client;
|
using Microsoft.AspNetCore.SignalR.Client;
|
||||||
@ -144,6 +145,12 @@ namespace osu.Game.Online
|
|||||||
var builder = new HubConnectionBuilder()
|
var builder = new HubConnectionBuilder()
|
||||||
.WithUrl(endpoint, options =>
|
.WithUrl(endpoint, options =>
|
||||||
{
|
{
|
||||||
|
// Use HttpClient.DefaultProxy once on net6 everywhere.
|
||||||
|
// The credential setter can also be removed at this point.
|
||||||
|
options.Proxy = WebRequest.DefaultWebProxy;
|
||||||
|
if (options.Proxy != null)
|
||||||
|
options.Proxy.Credentials = CredentialCache.DefaultCredentials;
|
||||||
|
|
||||||
options.Headers.Add("Authorization", $"Bearer {api.AccessToken}");
|
options.Headers.Add("Authorization", $"Bearer {api.AccessToken}");
|
||||||
options.Headers.Add("OsuVersionHash", versionHash);
|
options.Headers.Add("OsuVersionHash", versionHash);
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user