Java Server Sent Events Chat Example

fsdsdsdfsdfsd
didier
ca marche
ssssssssssssssssssssssssss
kk
pqlqlq
xcvz
zxczxc
aaaaaaaaaaaaaaaaaa
vjhf
dfs
wohaa
hla
lsls
dlldld
ll
helo
hello
feel alone
yo
seems working !!!
Simple Test

ddd
ss
artet
ooohjk
ooohjk
oo
pppp
rrrrrrrrrrr
llllllllllll
lllllllllkkkkkkkkkkkkkkkkk
jjjjjjjjjjjj
hhhhhhhhhhhhhhhhhhhhhhh
jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
nnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
ddddddddddddddddddddddddddddd
halooo
Manju
priya
vijay
hi
this is a demo chat
any one here?
fhhgfhd
hgfdhgfd
helo
sdsds
rtrt
aaaa
dsa
hola
ajdhslkdjsahldakjsdhañska
No Funciona!!!!
56
hola cabrones
sdfasds
gfgfgfdg
dsfsfs
rtrt
kokos
kasapis
apo thn poli erxome
tsioy tsioy
fiki fiki
santr
sisoftsantra
clear
return 0:
return0;
return 0;
exit (0);
.,m
ölkölöl,ö,
lkn
boo
hi there
this is me
test
zxczxc
czxc
sadsads
bvbvb
gfdgfgf
gfdgfgf
gfdgfgf
asdasd
Oi ?
Hello
er
hk
uuuuuuuu
hi
hi
Heelo
HI
hi
hi
Pradeep
Pradeep

Enter message in the field above and press Enter to send it.

This is a simple Java Server Sent Events chat example. It illustrates usage of technology - how with a few lines of code you can achieve simple chat application working in a modern browsers.

Of course this simple example gives you only basics functionality. Further you can improve it. Also you can consider using this technology for other areas where it is required mostly one way communication. E.g. client is subscribed and listen to changes such as price change, status update, live scores, etc.

To test it open this page in two different browsers. Note that Internet Explorer does not support SSE. So use Google Chrome and Mozilla Firefox.

For more info you can read following article Introduction to SSE with PHP example or directly look into SSE PHP example that updates stock prices when market moves.

Download source code Download WAR file Read Java SSE article