All Projects β†’ oraoto β†’ pony-websocket

oraoto / pony-websocket

Licence: MIT license
WebSocket server for Ponylang🐴

Programming Languages

Pony
23 projects
Makefile
30231 projects

Projects that are alternatives of or similar to pony-websocket

msgpack
🐴 Pure Pony implementation of the MessagePack serialization format. msgpack.org[Pony]
Stars: ✭ 31 (-27.91%)
Mutual labels:  ponylang, pony-language
kiuatan
A parser library for Pony.
Stars: ✭ 15 (-65.12%)
Mutual labels:  ponylang, pony-language
http
ponylang HTTP client library 🐴 πŸ•ΈοΈ
Stars: ✭ 38 (-11.63%)
Mutual labels:  ponylang, pony-language
Ponyc
🐴 Pony is an open-source, actor-model, capabilities-secure, high performance programming language
Stars: ✭ 4,857 (+11195.35%)
Mutual labels:  ponylang, pony-language
ponylang-linal
Linear Algebra library for Pony Language
Stars: ✭ 23 (-46.51%)
Mutual labels:  ponylang, pony-language
pony-inspect
Small Pony library for converting common objects to human-readable strings. 🐴 πŸ”
Stars: ✭ 24 (-44.19%)
Mutual labels:  pony-language
pony-capnp
Cap’n Proto plugin for generating serializable Pony classes. 🐴 - 🎩'n πŸ…ΏοΈ
Stars: ✭ 19 (-55.81%)
Mutual labels:  pony-language
ponylang-website
🐴 The ponylang.io website
Stars: ✭ 38 (-11.63%)
Mutual labels:  ponylang
pony-workshop
Material for a workshop for learning about the Pony programming language
Stars: ✭ 91 (+111.63%)
Mutual labels:  ponylang
Wally
Distributed Stream Processing
Stars: ✭ 1,461 (+3297.67%)
Mutual labels:  pony-language
ponycc
Pony package for parsing, manipulating, and compiling Pony code. 🐴 🐴
Stars: ✭ 34 (-20.93%)
Mutual labels:  pony-language
language-pony
Language support for Pony in Atom.
Stars: ✭ 14 (-67.44%)
Mutual labels:  pony-language
rfcs
🐴 RFCs for changes to Pony
Stars: ✭ 60 (+39.53%)
Mutual labels:  pony-language
pony-sodium
Safe Pony FFI wrapper for the libsodium cryptography library. 🐴 πŸ”
Stars: ✭ 24 (-44.19%)
Mutual labels:  pony-language
jylis
A distributed in-memory database for Conflict-free Replicated Data Types (CRDTs). 🌱 ↔️
Stars: ✭ 68 (+58.14%)
Mutual labels:  pony-language
pony-zmq
Pure Pony implementation of the ZeroMQ messaging library. 🐴 0️⃣ Ⓜ️ πŸ€
Stars: ✭ 64 (+48.84%)
Mutual labels:  pony-language
pony-tutorial
🐴 Tutorial for the Pony programming language
Stars: ✭ 247 (+474.42%)
Mutual labels:  pony-language
ponychat
My first Pony app - multi-user telnet-based chat
Stars: ✭ 13 (-69.77%)
Mutual labels:  pony-language
pony-kafka
🐴 Pure Pony Kafka client
Stars: ✭ 57 (+32.56%)
Mutual labels:  pony-language

pony-websocket

CircleCI stability

WebSocket server for pony

It's RFC6455 conformant, see test report.

Installation

  • Install corral
  • corral add github github.com/ponylang/net_ssl.git
  • corral fetch to fetch your dependencies
  • use "websocket" to include this package
  • corral run -- ponyc to compile your applicatpion

Select OpenSSL Version

You must select an SSL version to use.

Using OpenSSL 0.9.0

corral run -- ponyc -Dopenssl_0.9.0

Using OpenSSL 1.1.x:

corral run -- ponyc -Dopenssl_1.1.x

Usage

The API is model after the net package and much simplified.

Here is a simple echo server:

use "websocket"

actor Main
  new create(env: Env) =>
    try
      let listener = WebSocketListener(
        env.root as AmbientAuth, EchoListenNotify, "127.0.0.1","8989")
    end

class EchoListenNotify is WebSocketListenNotify
  // A tcp connection connected, return a WebsocketConnectionNotify instance
  fun ref connected(): EchoConnectionNotify iso^ =>
    EchoConnectionNotify

class EchoConnectionNotify is WebSocketConnectionNotify
  // A websocket connection enters the OPEN state
  fun ref opened(conn: WebSocketConnection ref) =>
    @printf[I32]("New client connected\n".cstring())

  // UTF-8 text data received
  fun ref text_received(conn: WebSocketConnection ref, text: String) =>
    // Send the text back
    conn.send_text(text)

  // Binary data received
  fun ref binary_received(conn: WebSocketConnection ref, data: Array[U8] val) =>
    conn.send_binary(data)

  // A websocket connection enters the CLOSED state
  fun ref closed(conn: WebSocketConnection ref) =>
    @printf[I32]("Connection closed\n".cstring())

An simplified API is also provided: example.

See more examples.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].