File tree 1 file changed +5
-2
lines changed
src/main/java/org/browsermob/proxy 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 13
13
import org .browsermob .proxy .jetty .util .InetAddrPort ;
14
14
import org .openqa .selenium .Proxy ;
15
15
16
+ import java .net .UnknownHostException ;
16
17
import java .util .Date ;
17
18
import java .util .Map ;
18
19
20
+ import java .net .InetAddress ;
21
+
19
22
20
23
public class ProxyServer {
21
24
private static final HarNameVersion CREATOR = new HarNameVersion ("BrowserMob Proxy" , "2.0" );
@@ -58,10 +61,10 @@ public void start() throws Exception {
58
61
server .start ();
59
62
}
60
63
61
- public org .openqa .selenium .Proxy seleniumProxy () {
64
+ public org .openqa .selenium .Proxy seleniumProxy () throws UnknownHostException {
62
65
Proxy proxy = new Proxy ();
63
66
proxy .setProxyType (Proxy .ProxyType .MANUAL );
64
- String proxyStr = String .format ("localhost :%d" , getPort ());
67
+ String proxyStr = String .format ("%s :%d" , InetAddress . getLocalHost (). getCanonicalHostName (), getPort ());
65
68
proxy .setHttpProxy (proxyStr );
66
69
proxy .setSslProxy (proxyStr );
67
70
You can’t perform that action at this time.
0 commit comments