Skip to content

Commit

Permalink
Allow non-local connections.
Browse files Browse the repository at this point in the history
Allow non-local connections.

Adding the .withAllowLocalOnly(false) call configures this proxy server to be
more similar to the prior v0_5 configuration. That is it:
1) No longer listens only on 127.0.0.1, required for this test to pass on
machines that are IPv6-only
2) Allows connections from a another machine where localhost would
otherwise resolve to the browser machine rather than the machine the
proxy server runs on (required for running the proxy server on the host
and the browser under test on a VM).
  • Loading branch information
joshbruning authored Aug 15, 2017
1 parent 88e08c8 commit eed161c
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public ProxyServer() {
String address = new NetworkUtils().getPrivateLocalAddress();
baseUrl = String.format("%s:%d", address, port);

proxyServer = DefaultHttpProxyServer.bootstrap().withPort(port)
proxyServer = DefaultHttpProxyServer.bootstrap().withAllowLocalOnly(false).withPort(port)
.withFiltersSource(new HttpFiltersSourceAdapter() {
public HttpFilters filterRequest(HttpRequest originalRequest, ChannelHandlerContext ctx) {
return new HttpFiltersAdapter(originalRequest) {
Expand Down

0 comments on commit eed161c

Please sign in to comment.