Example #1
0
 @Override
 public void start(String tapeName, Map arguments) {
   if (interceptor == null) {
     try {
       interceptor = new ProxyServer(this);
     } catch (UnknownHostException e) {
       throw new RuntimeException("Unable to start proxy", e);
     }
   }
   if (!interceptor.isRunning()) {
     interceptor.start();
   }
   super.start(tapeName, arguments);
 }
Example #2
0
 @Override
 public void stop() {
   interceptor.stop();
   super.stop();
 }
Example #3
0
 /** @return a `java.net.Proxy` instance configured to point to the Betamax proxy. */
 public Proxy getProxy() {
   return new Proxy(
       Proxy.Type.HTTP, new InetSocketAddress(interceptor.getHost(), interceptor.getPort()));
 }
Example #4
0
 /** @return the hostname or address where the proxy will run. */
 public String getProxyHost() {
   return interceptor.getHost();
 }