Skip to content

Latest commit

 

History

History
26 lines (18 loc) · 386 Bytes

README.md

File metadata and controls

26 lines (18 loc) · 386 Bytes

WebSocketServer

WebSocket Middleware/Responder for Slimane

Usage

Server

import WebSocketServer
import Slimane

let app = Slimane()

let wsServer = WebSocketServer { socket, request in
    socket.onText { text in
        socket.send("PONG")
    }
}

app.use(wsServer)

try! app.listen()

License

WS is released under the MIT license. See LICENSE for details.