question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Do not resolve unresolved address for request if the first handler in pipeline is SocksProxyHandler

See original GitHub issue

Expected behavior

Some interface for handlers (for example CanConnectUnresolved) that will force Netty to not resolve unresolved addresses for requests with the first handler that implemented this interface.

Socks5ProxyHandler & Socks4ProxyHandler have support for unresolved addresses and can be marked with this interface. It’s a very good way for actual proxy usage because this way address will not be resolved in the restricted network (e.g. Russian internet 😦 ) where DNS answers can be compromised.

Actual behavior

Netty always forces address resolving before starting the request pipeline.

Steps to reproduce

Start an HTTP request to the unresolved socket address.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:2
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
lygoingcommented, Aug 27, 2020

Bootstrap bootstrap = new Bootstrap();
bootstrap.resolver(NoopAddressResolverGroup.INSTANCE);

is OK.

2reactions
amalcommented, Dec 13, 2017

@normanmaurer I’m using netty via the heavily customized AsyncHttpClient.

SOCKS proxy support was added basing on this pull request: https://github.com/AsyncHttpClient/async-http-client/pull/1466/files#diff-e8a099a4ff024fa6b7322065055df7e0R413 It’s a link to the exact lines with pipeline change for adding proxy.

The main difference was that it didn’t work for me that way. I spent much time to understand that this way domain name address was resolved in my home network, not using the proxy so my network provider returned invalid IP address instead of actual, replacing responses from name servers. SocksProxyHandler class receives an already resolved address and uses IP address instead of domain for the new connection via proxy.

All works like a charm when SocksProxyHandler classes receive not resolved socket address and use the domain name instead of IP for connection. This way proxy resolves the name itself in the normal “not limited network”.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Message handlers and pipelines - IBM
A pipeline is a set of message handlers that are executed in sequence. ... Not every request is succeeded by a response; some...
Read more >
How to avoid broken master with Pipelines for Merged Results ...
This merge commit is written in refs/merge-requests/:iid/merge and does not change commit history of master branch. GitLab creates a pipeline on ...
Read more >
Sharing Context in MediatR Pipelines - Jimmy Bogard
MediatR, a small library that implements the Mediator pattern, helps simplify scenarios when you want a simple in-memory request/response ...
Read more >
ASP.NET: Request Processing, Filtering, and Content ...
HTTP modules are filters that can examine and modify the contents of HTTP request and response messages as they pass through the pipeline....
Read more >
Request Processing - Apache Software Foundation
This pipeline performs initial processing of the request. It can be extended by contributing a HttpServletRequestFilter into the HttpServletRequestHandler ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found