diff options
| author | JP Dillingham <jpdillingham@gmail.com> | 2021-05-17 08:27:23 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-05-17 08:27:23 -0500 |
| commit | 7b3bfb3ab5ee3f075fa63cef81e38c117f7f8ac8 (patch) | |
| tree | d4d6dd89af90d005c4c9db4ee1232c2e5a969733 /src/slskd/Options.cs | |
| parent | e22472791be56eb3b44d7af7064400aa5e6ef9fc (diff) | |
| parent | 2ebcc6f312d337d1bb4412b41781a973fb253aed (diff) | |
| download | slskd-7b3bfb3ab5ee3f075fa63cef81e38c117f7f8ac8.tar.gz | |
Merge pull request #72 from slskd/proxy
Add SOCKS5 proxy support
Diffstat (limited to 'src/slskd/Options.cs')
| -rw-r--r-- | src/slskd/Options.cs | 50 |
1 files changed, 49 insertions, 1 deletions
diff --git a/src/slskd/Options.cs b/src/slskd/Options.cs index 6074d650..efd689d5 100644 --- a/src/slskd/Options.cs +++ b/src/slskd/Options.cs @@ -265,6 +265,12 @@ namespace slskd public BufferOptions Buffer { get; private set; } = new BufferOptions(); /// <summary> + /// Gets connection proxy options. + /// </summary> + [Validate] + public ProxyOptions Proxy { get; private set; } = new ProxyOptions(); + + /// <summary> /// Connection buffer options. /// </summary> public class BufferOptions @@ -300,7 +306,7 @@ namespace slskd [EnvironmentVariable("SLSK_CONNECTION_TIMEOUT")] [Description("connection timeout, in milliseconds")] [Range(1000, int.MaxValue)] - public int Connect { get; private set; } = 5000; + public int Connect { get; private set; } = 10000; /// <summary> /// Gets the connection inactivity timeout, in milliseconds. @@ -311,6 +317,48 @@ namespace slskd [Range(1000, int.MaxValue)] public int Inactivity { get; private set; } = 15000; } + + /// <summary> + /// Connection proxy options. + /// </summary> + public class ProxyOptions + { + /// <summary> + /// Gets the proxy address. + /// </summary> + [Argument(default, "slsk-proxy-address")] + [EnvironmentVariable("SLSK_PROXY_ADDRESS")] + [Description("connection proxy address")] + [StringLength(255, MinimumLength = 1)] + public string Address { get; private set; } + + /// <summary> + /// Gets the proxy port. + /// </summary> + [Argument(default, "slsk-proxy-port")] + [EnvironmentVariable("SLSK_PROXY_PORT")] + [Description("connection proxy port")] + [Range(1, 65535)] + public int? Port { get; private set; } + + /// <summary> + /// Gets the proxy username, if applicable. + /// </summary> + [Argument(default, "slsk-proxy-username")] + [EnvironmentVariable("SLSK_PROXY_USERNAME")] + [Description("connection proxy username")] + [StringLength(255, MinimumLength = 1)] + public string Username { get; private set; } + + /// <summary> + /// Gets the proxy password, if applicable. + /// </summary> + [Argument(default, "slsk-proxy-password")] + [EnvironmentVariable("SLSK_PROXY_PASSWORD")] + [Description("connection proxy password")] + [StringLength(255, MinimumLength = 1)] + public string Password { get; private set; } + } } /// <summary> |
