Class SessionOptions
- Namespace
- VpnHood.Core.Server.Access.Configurations
- Assembly
- VpnHood.Core.Server.Access.dll
Represents the limits, timeouts and buffers of the server's sessions.
public class SessionOptions
- Inheritance
-
SessionOptions
- Inherited Members
Remarks
A setting left null takes its default, which the property of its name ending in Value
gives; a few have no default here and leave the server's own.
Properties
AllowQuicPacket
Gets or sets a value indicating whether the users' own QUIC may go in the tunnel, not the server's QUIC channel, or null for true.
public bool? AllowQuicPacket { get; set; }
Property Value
- bool?
Remarks
Turned off, the server drops the users' UDP to ports 80 and 443, but DNS's; it is enforced only with AllowTcpPacket off, as otherwise the tunnel carries the users' TCP as packets anyway.
AllowQuicPacketValue
Gets AllowQuicPacket, or its default, true.
[JsonIgnore]
public bool AllowQuicPacketValue { get; }
Property Value
AllowTcpForwarding
Gets or sets a value indicating whether TCP may go by forwarding: the client ends each TCP connection on the device and the server opens a new one, passing the bytes between them; or null for true.
public bool? AllowTcpForwarding { get; set; }
Property Value
- bool?
Remarks
Turning one way off leaves TCP going by the other (AllowTcpPacket); both off leave it no way through, which the server refuses.
AllowTcpForwardingValue
Gets AllowTcpForwarding, or its default, true.
[JsonIgnore]
public bool AllowTcpForwardingValue { get; }
Property Value
AllowTcpPacket
Gets or sets a value indicating whether TCP may go as raw IP packets in the tunnel, running end to end; or null for true.
public bool? AllowTcpPacket { get; set; }
Property Value
- bool?
AllowTcpPacketValue
Gets AllowTcpPacket, or its default, true.
[JsonIgnore]
public bool AllowTcpPacketValue { get; }
Property Value
AllowTcpProxy
Gets or sets AllowTcpForwarding under its former name, which server profiles, config files and older servers hold; a value under the new name wins.
[Obsolete("Use AllowTcpForwarding.")]
public bool? AllowTcpProxy { get; set; }
Property Value
- bool?
AllowUdpPacket
Gets or sets a value indicating whether the users' own UDP may go in the tunnel, not the server's UDP channel, or null for true.
public bool? AllowUdpPacket { get; set; }
Property Value
- bool?
Remarks
Turned off, the server drops the users' UDP, but DNS's; it is enforced only with AllowTcpPacket off, as for AllowQuicPacket.
AllowUdpPacketValue
Gets AllowUdpPacket, or its default, true.
[JsonIgnore]
public bool AllowUdpPacketValue { get; }
Property Value
ChannelIdleTimeout
Gets or sets how long the server keeps a client's idle connection open for its next request, which then has that long again, or null for 40 seconds; the client is told a little less.
public TimeSpan? ChannelIdleTimeout { get; set; }
Property Value
ChannelIdleTimeoutValue
Gets ChannelIdleTimeout, or its default, 40 seconds.
[JsonIgnore]
public TimeSpan ChannelIdleTimeoutValue { get; }
Property Value
IcmpTimeout
Gets or sets how long a destination a session pings stays tracked, where the server forwards ICMP itself, or null for 30 seconds; the ICMP workers themselves last 5 minutes idle.
[JsonConverter(typeof(TimeSpanConverter))]
public TimeSpan? IcmpTimeout { get; set; }
Property Value
IcmpTimeoutValue
Gets IcmpTimeout, or its default, 30 seconds.
[JsonIgnore]
public TimeSpan IcmpTimeoutValue { get; }
Property Value
MaxIcmpClientCount
Gets or sets the most ICMP workers a session may hold where the server forwards ICMP itself, or null for 20.
public int? MaxIcmpClientCount { get; set; }
Property Value
- int?
MaxIcmpClientCountValue
Gets MaxIcmpClientCount, or its default, 20.
[JsonIgnore]
public int MaxIcmpClientCountValue { get; }
Property Value
MaxPacketChannelCount
Gets or sets the most active TCP or QUIC packet channels a session may keep, which the server tells the client, or null for 8; the tunnel's UDP channel is apart.
public int? MaxPacketChannelCount { get; set; }
Property Value
- int?
MaxPacketChannelCountValue
Gets MaxPacketChannelCount, or its default, 8.
[JsonIgnore]
public int MaxPacketChannelCountValue { get; }
Property Value
MaxTcpChannelCount
Gets or sets the count of a session's forwarded TCP connections, packet channels and connects under way together at which the server refuses another forwarded TCP connection, or null for 1,000.
public int? MaxTcpChannelCount { get; set; }
Property Value
- int?
MaxTcpChannelCountValue
Gets MaxTcpChannelCount, or its default, 1,000.
[JsonIgnore]
public int MaxTcpChannelCountValue { get; }
Property Value
MaxTcpConnectWaitCount
Gets or sets the most TCP connects a session may have under way at once, or null for 500.
public int? MaxTcpConnectWaitCount { get; set; }
Property Value
- int?
MaxTcpConnectWaitCountValue
Gets MaxTcpConnectWaitCount, or its default, 500.
[JsonIgnore]
public int MaxTcpConnectWaitCountValue { get; }
Property Value
MaxTcpConnectsPerSecond
Gets or sets the most new TCP connections a session may make a second, or null for 200.
public int? MaxTcpConnectsPerSecond { get; set; }
Property Value
- int?
MaxTcpConnectsPerSecondValue
Gets MaxTcpConnectsPerSecond, or its default, 200: meant to be far above a browser's bursts and far below a SYN flood.
[JsonIgnore]
public int MaxTcpConnectsPerSecondValue { get; }
Property Value
MaxUdpClientCount
Gets or sets the most UDP workers a session may hold where the server forwards UDP itself, or null for 500; DNS's workers have their own quota.
public int? MaxUdpClientCount { get; set; }
Property Value
- int?
MaxUdpClientCountValue
Gets MaxUdpClientCount, or its default, 500.
[JsonIgnore]
public int MaxUdpClientCountValue { get; }
Property Value
MaxUdpDnsPacketsPerSecond
Gets or sets the most DNS packets over UDP a session may send a second, or null for 200.
public int? MaxUdpDnsPacketsPerSecond { get; set; }
Property Value
- int?
MaxUdpDnsPacketsPerSecondValue
Gets MaxUdpDnsPacketsPerSecond, or its default, 200: meant to be far above a device's own lookups and far below a flood that would get the server reported.
[JsonIgnore]
public int MaxUdpDnsPacketsPerSecondValue { get; }
Property Value
MaxUnauthenticatedConnectionCount
Gets or sets the most of the server's connections that have not proven a key yet, its port 80's included, or null for 1,000; above it, the address that holds the most loses its oldest.
public int? MaxUnauthenticatedConnectionCount { get; set; }
Property Value
- int?
MaxUnauthenticatedConnectionCountValue
Gets MaxUnauthenticatedConnectionCount, or its default, 1,000: an estimate, on the reasoning that a client's connection proves its key within about a second, so the count stays near the server's new connections a second, and a cap well above that leaves a mass reconnect alone.
[JsonIgnore]
public int MaxUnauthenticatedConnectionCountValue { get; }
Property Value
MinClientProtocolVersion
Gets or sets the oldest client protocol the server takes, or null for the server's own minimum; a lower value cannot lower that.
public int? MinClientProtocolVersion { get; set; }
Property Value
- int?
Remarks
At 15 or more, it is checked before the server reads a body or upgrades the connection. Below 15, a legacy client's hello is read, and a client older than the minimum is refused with an update message.
NetScanLimit
Gets or sets the most endpoints of one IPv4 /24 network a session may reach within NetScanTimeout, or null, as that one may be, for no limit. It counts the session's TCP connections whichever way they go, and its UDP and ICMP where the server forwards them itself.
public int? NetScanLimit { get; set; }
Property Value
- int?
NetScanTimeout
Gets or sets how long an endpoint counts toward NetScanLimit, or null, as that one may be, for no limit.
public TimeSpan? NetScanTimeout { get; set; }
Property Value
StartPadding
Gets or sets a value indicating whether the server adds cover traffic at the start of WebSocket forwarding streams, never of packet channels: null inherits a layered configuration, and an explicit false overrides true. The effective default is off.
public bool? StartPadding { get; set; }
Property Value
- bool?
StartPaddingValue
Gets StartPadding, or its default, false.
[JsonIgnore]
public bool StartPaddingValue { get; }
Property Value
StreamForwardingBufferSize
Gets or sets the buffer sizes of a TCP connection the server forwards, or null for the server's choice: about 8 KB each way.
public TransferBufferSize? StreamForwardingBufferSize { get; set; }
Property Value
StreamProxyBufferSize
Gets or sets StreamForwardingBufferSize under its former name; a value under the new name wins.
[Obsolete("Use StreamForwardingBufferSize.")]
public TransferBufferSize? StreamProxyBufferSize { get; set; }
Property Value
SyncCacheSize
Gets or sets the unreported traffic, in bytes, at which a session's traffic is due at once, reported at the server's next collection, or null for 100 MB (100,000,000 bytes).
public long? SyncCacheSize { get; set; }
Property Value
- long?
SyncCacheSizeValue
Gets SyncCacheSize, or its default, 100 MB (100,000,000 bytes).
[JsonIgnore]
public long SyncCacheSizeValue { get; }
Property Value
SyncInterval
Gets or sets how long after its last report a session's traffic is due again, which the server then reports at its next collection, or null for 20 minutes; it caps the status interval too.
[JsonConverter(typeof(TimeSpanConverter))]
public TimeSpan? SyncInterval { get; set; }
Property Value
Remarks
The access manager times out a live session it hears nothing of.
SyncIntervalValue
Gets SyncInterval, or its default, 20 minutes.
[JsonIgnore]
public TimeSpan SyncIntervalValue { get; }
Property Value
TcpConnectTimeout
Gets or sets how long a request on a new client connection may take, the server's connect to its destination included, and how long the server tries to answer or close a failed one, or null for 30 seconds; a client waits a little longer for the server's answer.
public TimeSpan? TcpConnectTimeout { get; set; }
Property Value
Remarks
A request on a kept connection has ChannelIdleTimeout instead.
TcpConnectTimeoutValue
Gets TcpConnectTimeout, or its default, 30 seconds.
[JsonIgnore]
public TimeSpan TcpConnectTimeoutValue { get; }
Property Value
TcpKernelBufferSize
Gets or sets the kernel buffer sizes of the server's TCP sockets, or null for the server's default, which is the OS's own unless the host sets one.
public TransferBufferSize? TcpKernelBufferSize { get; set; }
Property Value
TcpTimeout
Gets or sets a TCP idle timeout, or null for 15 minutes, which nothing in the server reads now.
[JsonConverter(typeof(TimeSpanConverter))]
public TimeSpan? TcpTimeout { get; set; }
Property Value
TcpTimeoutValue
Gets TcpTimeout, or its default, 15 minutes.
[JsonIgnore]
public TimeSpan TcpTimeoutValue { get; }
Property Value
Timeout
Gets or sets how long a session may go without activity before the server closes it, or null for 30 minutes.
[JsonConverter(typeof(TimeSpanConverter))]
public TimeSpan? Timeout { get; set; }
Property Value
TimeoutValue
Gets Timeout, or its default, 30 minutes.
[JsonIgnore]
public TimeSpan TimeoutValue { get; }
Property Value
UdpChannelBufferSize
Gets or sets the kernel buffer sizes of the socket of the tunnel's own UDP channel, or null for the server's own.
public TransferBufferSize? UdpChannelBufferSize { get; set; }
Property Value
UdpChannelBufferSizeValue
Gets UdpChannelBufferSize, which has no default here.
[JsonIgnore]
public TransferBufferSize? UdpChannelBufferSizeValue { get; }
Property Value
UdpForwardingBufferSize
Gets or sets the buffer sizes of the UDP forwarders' sockets, or null for the server's own; UdpChannelBufferSize is the tunnel's own UDP channel's.
public TransferBufferSize? UdpForwardingBufferSize { get; set; }
Property Value
UdpForwardingBufferSizeValue
Gets UdpForwardingBufferSize, which has no default here.
[JsonIgnore]
public TransferBufferSize? UdpForwardingBufferSizeValue { get; }
Property Value
UdpProxyBufferSize
Gets or sets UdpForwardingBufferSize under its former name; a value under the new name wins.
[Obsolete("Use UdpForwardingBufferSize.")]
public TransferBufferSize? UdpProxyBufferSize { get; set; }
Property Value
UdpTimeout
Gets or sets how long a session's UDP worker, where the server forwards UDP itself, may stay idle, or null for 1 minute; DNS's workers have their own, shorter timeout.
[JsonConverter(typeof(TimeSpanConverter))]
public TimeSpan? UdpTimeout { get; set; }
Property Value
UdpTimeoutValue
Gets UdpTimeout, or its default, 1 minute.
[JsonIgnore]
public TimeSpan UdpTimeoutValue { get; }
Property Value
Methods
ApplyDefaults()
Sets each option left null to its default; those with none here — the TCP buffers, the net scan limits and the client protocol — and the start padding, left to inherit, stay as they are.
public void ApplyDefaults()
Merge(SessionOptions)
Copies over these options each one another set sets.
public void Merge(SessionOptions obj)
Parameters
objSessionOptionsThe options that win where they are set.