Enterprise Java
WebServerSocket with JWebSocket in Java
First, go to http://jwebsocket.org/ to Download 2 package Server and Client . If you want to view Source, plz download source package.
- Server
- Unzip Server package.
- Go to “conf” folde
- Choose “jWebSocket.xml” file to open
- Edit “jWebSocket.xml” file, add more couple of tag <domain>null</domain> in couple of tag <domains> <domains>
- Save “jWebSocket.xml” file.
- Turn on Terminal, run Server
- Go to server folder contain “/bin/”
- type : input command to terminal
- For mac or Ubuntu: sh jWebSocketServer.sh
- For win : jWebSocketServer.bat
- Client :
- Unzip Client package.
- Run “index.html” file on browser.
- Choose Chat to test. Account login : you can find account Login in “jWebSocket.xml” file of Server Package. Login with each account in 2 windows others
- username1 : guest – password1 : guest
- username2 : user – password2 : user
- Result Testing Chat :
Done
Reference: WebServerSocket with JWebSocket in Java from our JCG partner Ha Bogay at the Java Monday Blog blog.