aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/slskd/Service.cs23
1 files changed, 17 insertions, 6 deletions
diff --git a/src/slskd/Service.cs b/src/slskd/Service.cs
index d7ea664e..8daab772 100644
--- a/src/slskd/Service.cs
+++ b/src/slskd/Service.cs
@@ -54,11 +54,16 @@ namespace slskd
RoomTracker = roomTracker;
SharedFileCache = sharedFileCache;
- var proxyOptions = new ProxyOptions(
- address: Options.Soulseek.Connection.Proxy.Address,
- port: Options.Soulseek.Connection.Proxy.Port,
- username: Options.Soulseek.Connection.Proxy.Username,
- password: Options.Soulseek.Connection.Proxy.Password);
+ ProxyOptions proxyOptions = default;
+
+ if (UsingProxy)
+ {
+ proxyOptions = new ProxyOptions(
+ address: Options.Soulseek.Connection.Proxy.Address,
+ port: Options.Soulseek.Connection.Proxy.Port.Value,
+ username: Options.Soulseek.Connection.Proxy.Username,
+ password: Options.Soulseek.Connection.Proxy.Password);
+ }
var connectionOptions = new ConnectionOptions(
readBufferSize: Options.Soulseek.Connection.Buffer.Read,
@@ -129,11 +134,17 @@ namespace slskd
private IRoomTracker RoomTracker { get; set; }
private ISharedFileCache SharedFileCache { get; set; }
private ITransferTracker TransferTracker { get; set; }
+ private bool UsingProxy => !string.IsNullOrWhiteSpace(Options.Soulseek.Connection.Proxy.Address) && Options.Soulseek.Connection.Proxy.Port.HasValue;
public async Task StartAsync(CancellationToken cancellationToken)
{
await Client.ConnectAsync(Options.Soulseek.Username, Options.Soulseek.Password).ConfigureAwait(false);
+ if (UsingProxy)
+ {
+ Logger.Information($"Using Proxy {Options.Soulseek.Connection.Proxy.Address}:{Options.Soulseek.Connection.Proxy.Port}");
+ }
+
Logger.Information("Connected and logged in as {Username}", Options.Soulseek.Username);
Logger.Information("Listening on port {Port}", Options.Soulseek.ListenPort);
Logger.Information("Client started");
@@ -403,7 +414,7 @@ namespace slskd
{
var info = new UserInfo(
description: $"Soulseek.NET Web Example! also, your username is {username}, and IP endpoint is {endpoint}",
- picture: System.IO.File.ReadAllBytes(@"slsk_bird.jpg"),
+ picture: Array.Empty<byte>(),
uploadSlots: 1,
queueLength: 0,
hasFreeUploadSlot: false);