ceylon.html 1.3.0 and ceylon.http.server.websocket 1.3.0

77 views
Skip to first unread message

Evgeniy Martin

unread,
Dec 22, 2016, 7:30:15 AM12/22/16
to ceylon-users
Hello,

Could i write program which can send message from server to web client (callbacks from some process, for example log ) using ceylon.httml and ceylon.http.server.websocket?

such as:
http://vertx.io/docs/vertx-sockjs-service-proxy/java/

something looks like:
shared void startServer() {
    value server
= newServer({
       
Endpoint {
            path
= isRoot();
            service
= (req, res) {
                renderTemplate
(
                   
Html {
                       
Body {
                            H1
{ "log:" }
                           
// some code that accepts messages from the server and displays on the Web screen
                       
}
                   
},
                    res
.writeString);
               
};
       
}
       
       
//,WebSocketEndpoint {
       
//    
       
//    some code that sends messages to the web client
       
//
       
//    }
       
   
}).start(SocketAddress("127.0.0.1",8080));
}

shared
void procces() {
   
// some process that generates callbacks
}

f I may do it, would you please write an example

Evgeniy Martin

unread,
Dec 28, 2016, 6:16:26 AM12/28/16
to ceylon-users

Enrique thanks a lot for good example ( https://github.com/chochos/script-bowl-chat ). But I can't run this app in both browser (farefox ,chrome). see attachment.

четверг, 22 декабря 2016 г., 15:30:15 UTC+3 пользователь Evgeniy Martin написал:

Evgeniy Martin

unread,
Dec 28, 2016, 9:15:17 AM12/28/16
to ceylon-users


on version 1.3.0 work only Firefox.

why are you  not store files (client.js, index.html, require.js, style.css) in a folder "resource"? I think it would be convenient.
Reply all
Reply to author
Forward
0 new messages