1# lws minimal ws server raw proxy 2 3This demonstrates how a vhost can be bound to a specific role and protocol, 4with the example using a lws plugin that performs raw packet proxying. 5 6By default the example will proxy 127.0.0.1:22, usually your ssh server 7listen port, on 127.0.0.1:7681. You should be able to ssh into port 7681 8the same as you can port 22. But your ssh server is only listening on port 22... 9 10## build 11 12To build this standalone, you must tell cmake where the lws source tree 13./plugins directory can be found, since it relies on including the source 14of the raw-proxy plugin. 15 16``` 17 $ cmake . -DLWS_PLUGINS_DIR=~/libwebsockets/plugins && make 18``` 19 20## usage 21 22Commandline option|Meaning 23---|--- 24-d <loglevel>|Debug verbosity in decimal, eg, -d15 25-r ipv4:address:port|Configure the remote IP and port that will be proxied, by default ipv4:127.0.0.1:22 26 27``` 28 $ ./lws-minimal-raw-proxy 29[2018/11/30 19:22:35:7290] USER: LWS minimal raw proxy | nc localhost 7681 30[2018/11/30 19:22:35:7291] NOTICE: Creating Vhost 'default' port 7681, 1 protocols, IPv6 off 31[2018/11/30 19:22:35:7336] NOTICE: callback_raw_proxy: onward ipv4 127.0.0.1:22 32... 33``` 34 35``` 36 $ ssh -p7681 me@127.0.0.1 37Last login: Fri Nov 30 19:29:23 2018 from 127.0.0.1 38[me@learn ~]$ 39``` 40 41 42