a lcx implementation based on libev.
so far, the project compiled on mac&linux, in theory, the code works on windows.
- install gcc/clang(the project needs c++0x, so at least, gcc should be 4.4.7)
- install libev, download the tarbar: libev, configure&make&make install
- install cmake, if you are using mac, brew install cmake should be enough; if you are using linux,the official binary is here: cmake
- checkout the source code, cd in
- make a build directory, such as:
mkdir build
, then cd in - generate cmake files:
cmake ..
- build:
make
this is the public visible middle server, which means that it should own a public ip.
it must listen on two port, one is called internal port, one is called external port.
the internal port is communicate with slave, the external port is communicate with clients.
this is a middleware which must connect listener and worker.
in our scenario, the worker is a service behind a NAT, such as docker or NAT router. then we use this tool "open" the service port of the worker.
finally, we got a port(external port) of listener is equal to a port of worker.
everything is inside the code, :-)