Add support for pluggable stream provider to enable SOCKS5 proxies#2251
Open
koepalex wants to merge 3 commits into
Open
Add support for pluggable stream provider to enable SOCKS5 proxies#2251koepalex wants to merge 3 commits into
koepalex wants to merge 3 commits into
Conversation
Introduces MQTTnet.Extensions.Socks5, enabling SOCKS5 proxy support for MQTTnet TCP transport. Adds IMqttClientStreamProvider interface, Socks5StreamProvider implementation, and related configuration options. Updates MqttTcpChannel to support stream providers and TLS layering. Includes unit tests with a fake SOCKS5 server and usage samples. Solution and project references updated accordingly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request adds SOCKS5 proxy support to the MQTTnet project, enabling MQTT clients to connect to brokers through SOCKS5 proxies, with or without authentication. It introduces a new extension library, integrates it into the solution and samples, and provides user-friendly configuration methods.
SOCKS5 Proxy Support Integration:
MQTTnet.Extensions.Socks5with all necessary source files and project configuration, providing SOCKS5 proxy support (RFC 1928/1929) for MQTTnet TCP transport. (Source/MQTTnet.Extensions.Socks5/MQTTnet.Extensions.Socks5.csproj,Source/MQTTnet.Extensions.Socks5/Socks5Protocol.cs,Source/MQTTnet.Extensions.Socks5/Socks5NetworkStream.cs) [1] [2] [3]MqttClientOptionsBuilderto allow easy configuration of SOCKS5 proxies, including support for authentication and advanced options. (Source/MQTTnet.Extensions.Socks5/MqttClientOptionsBuilderExtensions.cs)Solution and Sample Integration:
MQTTnet.Extensions.Socks5and its test project in the main solution file, and added support for additional build configurations (x64, x86). (MQTTnet.sln)Samplesproject to reference the new extension and added sample code demonstrating how to connect to MQTT brokers via SOCKS5 proxies, including both unauthenticated and authenticated scenarios. (Samples/MQTTnet.Samples.csproj,Samples/Client/Client_Socks5_Samples.cs) [1] [2]