Skip to content

this is simple applicatio java implimentation api tyrus based in glassfish

Notifications You must be signed in to change notification settings

sidahmedbenkhaoua/app-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

app-server

java web socket this is simple applicatio java implimentation api tyrus based in glassfish to deploye application : 1-meven 2 or 3 2-maven install open project in your ide eclipse or netbeanse or intelig ide and run class sbenkhaoua.app.tools.spec.SampleStandalone and try to write a simple page html to connect to this socket index.html

<html>
    <head>
    <meta charset="UTF-8">
     <title>WebSocket Client</title>

<script type="text/javascript">
    var webSocket_;

    var wsOpen = function() {
        webSocket_ = new WebSocket('ws://localhost:8025/websockets/echo');
        webSocket_.onmessage = function(e) {
            dump(e);
            var msg = document.getElementById('msg');
            msg.innerHTML = e.data + '<br/>' + msg.innerHTML;
        };
    };

    var wsClose = function() {
        if (webSocket_) {
            webSocket_.close(1000, 'Closed by user.');
            webSocket_ = null;
        }
    };

    var wsSend = function(t) {
        if (webSocket_) {
            console.log('send message : ' + t.value);
            webSocket_.send(t.value);
        }
    };
</script>

About

this is simple applicatio java implimentation api tyrus based in glassfish

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages