Custom interceptor for Thinktecture.RelayServer that provides Memcached as a temporary shared store for its large request and response delivery (i.e. anything over 64kb) to overcome the SignalR limitations.
Custom interceptor also makes Thinktecture.RelayServer
RFC 7239 compliant and Forwarded HTTP Header aware.
The Forwarded HTTP Header handler automatically upgrades any legacy forwarded headers including X-Forwarded-For, X-Forwarded-Proto, X-Forwarded-Port, X-Forwarded-Host and X-Forwarded-Path.
Thinktecture.Relay.ForwardedMemcachedCustomCode.dll.config can be used to configure the custom code. Available settings are:
ObfuscateForHeader
(true/false) - Allows you to control whether you want to obfuscate the client information in the Forwarded header to prevent leaking any internal network information. True by default.TemporaryRequestStorageMemcachedNodeEndPoint
(string) - Connection string to a single Memcached Node end-point. Format is{IP/DNS}:{PORT}
TemporaryRequestStorageMemcachedConfigEndPoint
(string) - Connection string to a Memcached Configuration end-point. This is a bespoke Amazon AWS Auto Discovery service that keeps track of all available nodes in a cluster. Format is{IP/DNS}:{PORT}
TemporaryRequestStoragePeriod
(timespan) - Allows you to define the Memcached expiry time. Default is 00:00:10 (i.e. 10 seconds).
- Custom Code is compatible with
Thinktecture.RelayServer
v2.1.0 and higher. - Forwarded HTTP Header handles a non-standard parameter
Path
which is commonly used however not a standard. This is required to ensure target application can re-write its links and adjust the path. - Ensure to merge the Enim.Caching runtime assembly bindings into the Thinktecture.Relay.Server app.config file for deployment
- Big thanks to guys at Thinktecture for their wonderful work on RelayServer and accepting some of my changes.
- Thanks to Attila Kiskó for creating the C# Memcached Client - EnyimMemcached