Skip to content

blutack/crysocket

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

crysocket

Travis build status Heroku

A basic Kemal toy application which serves a timestamp over websockets and a JSON endpoint.

Usage

First install Crystal if you don't already have it. Then in the checkout of this repository:

$ shards install
$ crystal build --release src/crysocket.cr
$ ./crysocket

To test, open a browser tab and enter the following into the developer javascript console:

ws = new WebSocket("wss:https://crysocket.herokuapp.com/socket")
ws.onmessage = msg => console.log(msg.data)

The timestamp should update approximately every second.

Alternatively, access the GET endpoint at https://crysocket.herokuapp.com/time

About

Crystal Timestamp Websocket Server

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published