use of com.predic8.membrane.core.HttpRouter in project service-proxy by membrane.
the class Http11Test method setUp.
@Before
public void setUp() throws Exception {
Rule rule = new ServiceProxy(new ServiceProxyKey("localhost", "POST", ".*", 4000), "thomas-bayer.com", 80);
router = new HttpRouter();
router.getRuleManager().addProxyAndOpenPortIfNew(rule);
router.init();
}
use of com.predic8.membrane.core.HttpRouter in project service-proxy by membrane.
the class ViaProxyTest method setUp.
@Before
public void setUp() throws Exception {
ProxyConfiguration proxy = new ProxyConfiguration();
proxy.setHost("localhost");
proxy.setPort(3128);
proxyRouter = new HttpRouter(proxy);
proxyRouter.getRuleManager().addProxy(new ProxyRule(new ProxyRuleKey(3128)), RuleDefinitionSource.MANUAL);
proxyRouter.init();
router = new HttpRouter();
router.getRuleManager().addProxyAndOpenPortIfNew(new ServiceProxy(new ServiceProxyKey("localhost", "POST", ".*", 4000), "thomas-bayer.com", 80));
router.init();
}
use of com.predic8.membrane.core.HttpRouter in project service-proxy by membrane.
the class MultipleLoadBalancersTest method setUp.
@Before
public void setUp() throws Exception {
service1 = new MockService(2001);
service2 = new MockService(2002);
service11 = new MockService(2011);
service12 = new MockService(2012);
balancer = new HttpRouter();
balancingInterceptor1 = createBalancingInterceptor(7000, "Default");
balancingInterceptor2 = createBalancingInterceptor(7001, "Balancer2");
BalancerUtil.lookupBalancer(balancer, "Default").up("Default", "localhost", service1.port);
BalancerUtil.lookupBalancer(balancer, "Default").up("Default", "localhost", service2.port);
BalancerUtil.lookupBalancer(balancer, "Balancer2").up("Default", "localhost", service11.port);
BalancerUtil.lookupBalancer(balancer, "Balancer2").up("Default", "localhost", service12.port);
roundRobinStrategy1 = new RoundRobinStrategy();
roundRobinStrategy2 = new RoundRobinStrategy();
}
use of com.predic8.membrane.core.HttpRouter in project service-proxy by membrane.
the class InterceptorInvocationTest method createRouter.
private HttpRouter createRouter() throws Exception {
HttpRouter router = new HttpRouter();
router.getRuleManager().addProxyAndOpenPortIfNew(createServiceProxy());
addMockInterceptors(router, regularInterceptorNames);
router.init();
return router;
}
use of com.predic8.membrane.core.HttpRouter in project service-proxy by membrane.
the class ConnectionTest method setUp.
@Before
public void setUp() throws Exception {
Rule rule2000 = new ServiceProxy(new ServiceProxyKey("localhost", "*", ".*", 2000), "predic8.com", 80);
router = new HttpRouter();
router.getRuleManager().addProxyAndOpenPortIfNew(rule2000);
conLocalhost = Connection.open("localhost", 2000, null, null, 30000);
con127_0_0_1 = Connection.open("127.0.0.1", 2000, null, null, 30000);
}
Aggregations