0

The common problem with microservices is that developing them can be cumbersome if you use AJAX and try to read input from multiuple hosts/ports (due to cross domain requests).

I am looking for a very simple solution that would work with linux (preferably using python or socat) where I can chain few hosts/ports under a single port.

host1:port1/service1 and host2:port2/service2 ... -> localhost:port

All remote hosts/ports can be accessed from the same localhost:port.

The requests should be forwarded based on the paths:

localhost:port/service1 -> host1:port1/service1 
localhost:port/service2 -> host2:port2/service2

1 Answer 1

1

a http reverse proxy will do , like this apache config with mod_proxy enabled .

Listen port
ProxyPass /service1 http://host1:port1/service1
ProxyPass /service2 http://host1:port1/service2

dispatching localhost:port/service1 and localhost:port/service2 involves knowledge of http protocol . the service is not distinguished on the tcp layer , but a http get request . i am not aware of that socat can handle this .

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .