Skip to content

Instantly share code, notes, and snippets.

@kalaiyarasiganeshalingam
Last active October 5, 2020 07:31
Show Gist options
  • Select an option

  • Save kalaiyarasiganeshalingam/b948c44202797dafdf20eede75720278 to your computer and use it in GitHub Desktop.

Select an option

Save kalaiyarasiganeshalingam/b948c44202797dafdf20eede75720278 to your computer and use it in GitHub Desktop.
server with a single resource
import ballerina/http;
import ballerina/log;
@http:WebSocketServiceConfig {
path: "/hello/ws"
}
service basic on new http:Listener(21005) {
// The resource is triggered after a successful client connection
resource function onOpen(http:WebSocketCaller caller) {
log:printInfo("connection open");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment