A simple Java Websocket Server and Client with a minimal javascript web client.
mvn clean packageBy default the server and the client bind on localhost:8025
Run the server
java -jar Server/target/Server-2.0-jar-with-dependencies.jarRun one or mode clients
java -jar JavaClient/target/JavaClient-2.0-jar-with-dependencies.jarRun the web client in a jetty server
mvn --projects WebClient jetty:run-warLaunch the server with a name and mapped port.
docker run \
--rm -it \
-p 8025:8025 \
--name wsserver \
docker.io/brunoe/demowebsocket.server:developLaunch one or more client linked to the server.
docker run \
--rm -it \
--link wsserver \
--env JAVA_OPTS="-Dfr.univtln.bruno.demo.websocket.server.ip=wsserver" \
docker.io/brunoe/demowebsocket.javaclient:developLaunch one or more web clients and open http://localhost:8080 (or map another port). Warning, the client is Javascript executed in the browser, so the web socket server must be reachable from there and not from the container (so it needs to be mapped to an host port).
docker run \
--link wsserver \
--rm \
-p 8080:8080 \
brunoe/demowebsocket.webclient:develop