- compile shared library:
$ cc -shared -fPIC -Wl,--no-as-needed -ldl -lpthread -Wl,-soname=forward.so -o forward.so forward.c
- Run standard redis server in separate terminal
$ redis-server
- Start vaurien with 10000 port offset
$ vaurien --proxy 127.0.0.1:16379 --backend 127.0.0.1:6379 --protocol redis --behavior 100:delay
- Test code without vaurien
$ python test.py
12
0.00104689598083
- Test code WITH vaurien but without changing any configuration
LD_PRELOAD=./forward.so python test.py
Proxy: 6379 -> 16379
Proxy: 6379 -> 16379
12
2.00729990005
- Don't use it in production :-)
KUDOS and inspiration: proxychains library