[Tooltip("Protect against allocation attacks by keeping the max message size small. Otherwise an attacker might send multiple fake packets with 2GB headers, causing the server to run out of memory after allocating multiple large packets.")]
public int maxMessageSize = 16 * 1024;
[Tooltip("Max size for http header send as handshake for websockets")]
public int handshakeMaxSize = 3000;
[Tooltip("disables nagle algorithm. lowers CPU% and latency but increases bandwidth")]
public bool noDelay = true;
[Tooltip("Send would stall forever if the network is cut off during a send, so we need a timeout (in milliseconds)")]
public int sendTimeout = 5000;
[Tooltip("How long without a message before disconnecting (in milliseconds)")]
public int receiveTimeout = 20000;
[Tooltip("Caps the number of messages the server will process per tick. Allows LateUpdate to finish to let the reset of unity contiue incase more messages arrive before they are processed")]
public int serverMaxMessagesPerTick = 10000;
[Tooltip("Caps the number of messages the client will process per tick. Allows LateUpdate to finish to let the reset of unity contiue incase more messages arrive before they are processed")]
public int clientMaxMessagesPerTick = 1000;
[Header("Server settings")]
[Tooltip("Groups messages in queue before calling Stream.Send")]
public bool batchSend = true;
[Tooltip("Waits for 1ms before grouping and sending messages. " +
"This gives time for mirror to finish adding message to queue so that less groups need to be made. " +
"If WaitBeforeSend is true then BatchSend Will also be set to true")]
public bool waitBeforeSend = false;
[Header("Ssl Settings")]
[Tooltip("Sets connect scheme to wss. Useful when client needs to connect using wss when TLS is outside of transport, NOTE: if sslEnabled is true clientUseWss is also true")]
public bool clientUseWss;
public bool sslEnabled;
[Tooltip("Path to json file that contains path to cert and its password\n\nUse Json file so that cert password is not included in client builds\n\nSee cert.example.Json")]
public string sslCertJson = "./cert.json";
public SslProtocols sslProtocols = SslProtocols.Tls12;
[Header("Debug")]
[Tooltip("Log functions uses ConditionalAttribute which will effect which log methods are allowed. DEBUG allows warn/error, SIMPLEWEB_LOG_ENABLED allows all")]