Skip to content
New issue

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

Why there is no Regex Support for excludeList of nonProxyHost #8329

Open
kasingal opened this issue Jul 22, 2022 · 8 comments · May be fixed by #10538
Open

Why there is no Regex Support for excludeList of nonProxyHost #8329

kasingal opened this issue Jul 22, 2022 · 8 comments · May be fixed by #10538
Assignees
Milestone

Comments

@kasingal
Copy link

kasingal commented Jul 22, 2022

Code at line below should be enhanced:
https://github.com/eclipse/jetty.project/blob/8102378e2d24b8117ed3a545c7579f79d35fc45a/jetty-client/src/main/java/org/eclipse/jetty/client/ProxyConfiguration.java#L180

Generally nonProxyHosts gets defined with wildcards like *.abc.com|*.svc.local etc.. so .equals doesn't help !
And apparently Jetty Client doesn't have any support for wildcard list of nonProxyHosts !!

PS: reactor-netty handles it pretty well, refer below:
https://github.com/reactor/reactor-netty/blob/main/reactor-netty-core/src/main/java/reactor/netty/transport/ProxyProvider.java#L310

@joakime
Copy link
Contributor

joakime commented Jul 22, 2022

What version of Jetty?

@kasingal
Copy link
Author

kasingal commented Jul 22, 2022

Any version till date.. there is no support for the pattern match there on the line I just tagged to the ticket !
Better to have it enhanced in 9.4.x and higher versions !

@sbordet
Copy link
Contributor

sbordet commented Jul 28, 2022

@kasingal we accept pull requests. Do you want to try to fix this issue and submit a pull request? Thanks!

@joakime
Copy link
Contributor

joakime commented Jul 28, 2022

If you decide to do a pull request, make it against branch jetty-10.0.x only, we'll handle the merging to jetty-11.0.x and jetty-12.0.x ourselves.

@github-actions
Copy link

This issue has been automatically marked as stale because it has been a
full year without activity. It will be closed if no further activity occurs.
Thank you for your contributions.

@github-actions github-actions bot added the Stale For auto-closed stale issues and pull requests label Jul 29, 2023
@sbordet sbordet removed the Stale For auto-closed stale issues and pull requests label Jul 29, 2023
@sugilite
Copy link

sugilite commented Aug 8, 2023

I would like to work on this issue.
Is targeting jetty-10.x still the way to go about it? Thanks

@sbordet
Copy link
Contributor

sbordet commented Aug 8, 2023

Yes, please target branch jetty-10.0.x. Thanks!

sugilite added a commit to sugilite/jetty.project that referenced this issue Sep 17, 2023
Signed-off-by: Lukas Gisi <lukasgisi@gmail.com>
sugilite added a commit to sugilite/jetty.project that referenced this issue Sep 17, 2023
Signed-off-by: Lukas Gisi <lukasgisi@gmail.com>
@sugilite
Copy link

sugilite commented Sep 17, 2023

Hi - I opened PR #10538. First contribution to this project - feedback is always welcome.
Currently only allows for wildcards at the start and end of the host. This matches the behavior of the jdk default via nonProxyHosts, see:

The patterns may start or end with a '*' for wildcards.
(https://docs.oracle.com/javase/8/docs/technotes/guides/net/proxies.html)

I think this satisfies most use cases.

If we (you) also want to support wildcards in the middle maybe something like this works better:

      String hostRegex = Arrays.stream(host.split("\\*"))
        .map(s -> {
            if (s.length() > 0) {
                return Pattern.quote(s);
            }
            return s;
        })
        .collect(Collectors.joining(".*"));

@joakime joakime linked a pull request Sep 17, 2023 that will close this issue
@joakime joakime added this to the 10.0.x milestone Sep 17, 2023
sugilite added a commit to sugilite/jetty.project that referenced this issue Sep 24, 2023
…r same hosts

Signed-off-by: Lukas Gisi <lukasgisi@gmail.com>
sugilite added a commit to sugilite/jetty.project that referenced this issue Sep 24, 2023
… patterns

Signed-off-by: Lukas Gisi <lukasgisi@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging a pull request may close this issue.

4 participants