We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Most of the use cases we have requires proxy support for the MQTT client. Do we have this feature
can MqttChannelInitializer have the ability to inject proxy handler as part of initMqtt(...) methods
adding proxy to pipeline:
private void addProxyHandlerIfNeeded(ChannelPipeline pipeline, HttpProxyConfig httpProxyConfig, @Nullable String passwordOverride) throws Exception { String proxyHost = httpProxyConfig.host(); if (proxyHost.isEmpty()) { return; } int proxyPort = MoreObjects.firstNonNull(httpProxyConfig.port(), 80); SocketAddress proxyAddress = new InetSocketAddress(proxyHost, proxyPort); String username = httpProxyConfig.username(); if (username.isEmpty()) { pipeline.addLast(new HttpProxyHandler(proxyAddress)); } else { String password = getPassword(httpProxyConfig, passwordOverride); pipeline.addLast(new HttpProxyHandler(proxyAddress, username, password)); } }
Proxy handler similar to below :
public final ProxyHandler newProxyHandler() { InetSocketAddress proxyAddr = this.address.get(); String username = this.username; String password = Objects.nonNull(username) && Objects.nonNull(this.password) ? this.password.apply(username) : null; switch (this.type) { case HTTP: return Objects.nonNull(username) && Objects.nonNull(password) ? new HttpProxyHandler(proxyAddr, username, password) : new HttpProxyHandler(proxyAddr); case SOCKS4: return Objects.nonNull(username) ? new Socks4ProxyHandler(proxyAddr, username) : new Socks4ProxyHandler(proxyAddr); case SOCKS5: return Objects.nonNull(username) && Objects.nonNull(password) ? new Socks5ProxyHandler(proxyAddr, username, password) : new Socks5ProxyHandler(proxyAddr); } throw new IllegalArgumentException("Proxy type unsupported : " + this.type); }
The text was updated successfully, but these errors were encountered:
@sameerhr84 proxy support is now part of version 1.2.0
Sorry, something went wrong.
Thank you @SgtSilvio for helping with this feature request.
SgtSilvio
Successfully merging a pull request may close this issue.
Problem or use case
Most of the use cases we have requires proxy support for the MQTT client. Do we have this feature
Preferred solution or suggestions
can MqttChannelInitializer have the ability to inject proxy handler as part of initMqtt(...) methods
adding proxy to pipeline:
Proxy handler similar to below :
The text was updated successfully, but these errors were encountered: