Guide of how to start and config jetty dynamic at code - http://www.onjava.com/lpt/a/6623 , even change the config after the server started. Websocket coding sample - http://aredko.blogspot.hk/2013/11/java-websockets-jsr-356-on-jetty-91.html