Skip to content

VpnHood Server Configuration

Trudy edited this page Dec 26, 2022 · 46 revisions

VpnHood Server does not need many configurations. The vpnHood server uses the default value for any item you remove. You can config the server by putting "appsettings.json" in the root folder of the VpnHood server beside "publish.json".

If there is no "appsettings.json" file, the default value shown below will be used.

appsettings.json

{
  "RestAccessServer": null,
  "FileAccessServer": {
    "TcpEndPoints": [ "0.0.0.0:443", "[::]:443" ],
    "SslCertificatesPassword": null,
    "Tracking": {
      "TrackClientIp": false,
      "TrackLocalPort": false,
      "TrackDestinationIp": false,
      "TrackDestinationPort": false
    },
    "Session": {
      "Timeout": 600,
      "UdpTimeout": 60,
      "TcpTimeout": 900,
      "IcmpTimeout": 30,
      "MaxDatagramChannelCount": 8,
      "MaxUdpPortCount": 0,
      "TcpBufferSize": 8192
    }
  },
  "IsDiagnoseMode": false
}

RestAccessServer

Use this to connect the VpnHood server to an enterprise Access Server. Please set it to null to use VpnHood's built-in simple file access server. A simple file access server is enough to run a server.

FileAccessServer

TcpEndPoints

The TCP listening ports on your server. VpnHood server does not require any root or admin access, but listening to the TCP/IP port numbers below 1024 is special and regular users are not allowed to run on some servers.

SslCertificatesPassword

VpnHood generated a random self-signed certificate as "default.pfx". You need to specify its password here if you changed it with a password-protected pfx.

Tracking

TrackClientIp

If true, then the VpnHood server logs the client's IP along with the session number.

TrackLocalPort

If true, then the VpnHood server logs every local port number opened to the outside world along with the session number.

TrackDestinationIp

If true, then the VpnHood server logs the redacted destination IP requested by the user.

TrackDestinationPort

If true, then the VpnHood server logs the destination port requested by the user.

Session

Timeout

VpnHood server closes idle sessions after this period in seconds.

UdpTimeout

VpnHood server's internal NAT closes UDP ports to the outside world after this period in seconds. It is the same as ordinary NAT.

TcpTimeout

VpnHood server closes idle TCP sessions after this period in seconds. Detecting dead TCP connections is a challenging decision; VpnHood uses keep alive for TCP connections and closes the idle TCP connection only if the socket poll returns an error after this period.

MaxDatagramChannelCount

It limits the maximum allowed TcpDatagram channel from a client. VpnHood server closes old TCP channels if a VpnHood client request more. VpnHood client reads this value from the server and does not request more TcpDatagram channels suppressing the user config.

Note: This value does not affect when using UdpChannel. There is only one UdpChannel in UDP mode.

MaxUdpPortCount

It limits the maximum concurrent UDP port from a client. Ordinary users merely need to open more than 100 simultaneous UDP ports unless they use torrent apps. The default is 0, which means unlimited.

TcpBufferSize

The TCP buffer size for every TcpProxy request. Each TCP proxy uses two TCP connections. An ordinary user may request about 500 simultaneous TCP proxies in a session. VpnHood Server consumes much memory if many users connect to your server, especially if you increase this value, so the default value is highly recommended.

Misc

IsDiagnoseMode

It must be true to log some packet deep-level logging. It puts much overhead on your machine if you set it to true.