Skip to content

Instantly share code, notes, and snippets.

@aschuhardt
aschuhardt / StreamExtensions.cs
Last active July 21, 2023 23:34
An implementation of the PROXY-protocol (version 2) for .NET/C# Stream objects
/*
Copyright 2023 by Addison Schuhardt
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
stream {
###
### Setup
###
# connection-limiting
limit_conn_zone $binary_remote_addr zone=addr:10m;
limit_conn_log_level warn;
limit_conn addr 1;