-
Notifications
You must be signed in to change notification settings - Fork 0
Server Usage
usage: Main
-e,--emit Emit events for testing purposes (false)
-h,--help Show help.
-l,--log-level <arg> Log level: trace, debug, info, warn, or error
(warn)
-m,--log-mbs <arg> Log rollover MB trigger (5)
-p,--port <arg> TCP port to listen on for WebSocket connections
(8887)
The server options are pretty self-explanatory, I hope. The defaults are in parentheses. A few comments.
The events that are output when this flag is set come once a second. The event names are "Ad", "Search" and "Click". Connect with a client that asks for all messages and attributes and you can see the details.
Most of the logging options are hard-coded. The server logs to stdout and into a file named lwesws.log in the current directory using a rolling file appender. By default at log level WARN and 5MB files before rollover. You can change these two options with the flags.
> git clone https://github.com/laboo/lwes-websocket-server.git
> cd lwes-websocket-server
> ./gradlew clean shadowJar
> java -jar build/lib/lwes-websocket-server-0.3.2-all.jar -e -l DEBUG
That will start the server on localhost:8887 with events being emitted every second. You can see those events by running either of the clients in another terminal window. Here's how to start the Java client.
> java -cp build/lib/lwes-websocket-server-0.3.2-all.jar com.github.laboo.lwes.client/WSClient