All Projects → tonyg → racket-rfc6455

tonyg / racket-rfc6455

Licence: other
RFC 6455 WebSockets support for Racket.

Programming Languages

racket
414 projects

Projects that are alternatives of or similar to racket-rfc6455

Ws
Simple to use, blazing fast and thoroughly tested WebSocket client and server for Node.js
Stars: ✭ 17,419 (+54334.38%)
Mutual labels:  websocket-server, websocket-client, rfc-6455
Websocat
Command-line client for WebSockets, like netcat (or curl) for ws:// with advanced socat-like functions
Stars: ✭ 3,477 (+10765.63%)
Mutual labels:  websocket-server, websocket-client, rfc-6455
Rockets
REST and websockets C++ library
Stars: ✭ 39 (+21.88%)
Mutual labels:  websocket-server, websocket-client
Jiny
Lightweight, modern, simple JVM web framework for rapid development in the API era
Stars: ✭ 40 (+25%)
Mutual labels:  websocket-server, websocket-client
WebSocketListener
A lightweight and highly scalable asynchronous WebSocket listener
Stars: ✭ 70 (+118.75%)
Mutual labels:  websocket-server, websocket-client
Oatpp Websocket
oatpp-websocket submodule.
Stars: ✭ 26 (-18.75%)
Mutual labels:  websocket-server, websocket-client
Awesome Websockets
A curated list of Websocket libraries and resources.
Stars: ✭ 850 (+2556.25%)
Mutual labels:  websocket-server, websocket-client
Websocket
A PHP implementation of WebSocket.
Stars: ✭ 54 (+68.75%)
Mutual labels:  websocket-server, websocket-client
Websocket
The Hoa\Websocket library.
Stars: ✭ 421 (+1215.63%)
Mutual labels:  websocket-server, websocket-client
Arduinowebsockets
arduinoWebSockets
Stars: ✭ 1,265 (+3853.13%)
Mutual labels:  websocket-server, websocket-client
Sketchpad
Sketchpad is fully customisable collaborative whiteboard plugin written in pure JavaScript.
Stars: ✭ 85 (+165.63%)
Mutual labels:  websocket-server, websocket-client
Php Wss
Web-socket server/client with multi-process and parse templates support on server and send/receive options on client
Stars: ✭ 117 (+265.63%)
Mutual labels:  websocket-server, websocket-client
Sylar
C++高性能分布式服务器框架,webserver,websocket server,自定义tcp_server(包含日志模块,配置模块,线程模块,协程模块,协程调度模块,io协程调度模块,hook模块,socket模块,bytearray序列化,http模块,TcpServer模块,Websocket模块,Https模块等, Smtp邮件模块, MySQL, SQLite3, ORM,Redis,Zookeeper)
Stars: ✭ 895 (+2696.88%)
Mutual labels:  websocket-server, websocket-client
Ulfius
Web Framework to build REST APIs, Webservices or any HTTP endpoint in C language. Can stream large amount of data, integrate JSON data with Jansson, and create websocket services
Stars: ✭ 666 (+1981.25%)
Mutual labels:  websocket-server, websocket-client
Stl.fusion
Get real-time UI updates in Blazor apps and 10-1000x faster API responses with a novel approach to distributed reactive computing. Fusion brings computed observables and automatic dependency tracking from Knockout.js/MobX/Vue to the next level by enabling a single dependency graph span multiple servers and clients, including Blazor apps running in browser.
Stars: ✭ 858 (+2581.25%)
Mutual labels:  websocket-server, websocket-client
Autobahn Testsuite
Autobahn WebSocket protocol testsuite
Stars: ✭ 603 (+1784.38%)
Mutual labels:  websocket-server, websocket-client
Libhv
🔥 比libevent、libuv更易用的国产网络库。A c/c++ network library for developing TCP/UDP/SSL/HTTP/WebSocket client/server.
Stars: ✭ 3,355 (+10384.38%)
Mutual labels:  websocket-server, websocket-client
Websockets
Library for building WebSocket servers and clients in Python
Stars: ✭ 3,724 (+11537.5%)
Mutual labels:  websocket-server, websocket-client
Deno Websocket
🦕 A simple WebSocket library like ws of node.js library for deno
Stars: ✭ 74 (+131.25%)
Mutual labels:  websocket-server, websocket-client
Embedded Jetty Websocket Examples
Embedded Jetty WebSocket Examples
Stars: ✭ 159 (+396.88%)
Mutual labels:  websocket-server, websocket-client

RFC 6455 WebSockets for Racket

This package, rfc6455, provides RFC 6455 compatible WebSockets server and client interfaces for Racket, building on Racket's web-server collection.

Besides support for RFC 6455, the final WebSockets standard, the package also incorporates code supporting the earlier, draft hybi-00 proposal, because several common older browsers still use this protocol variant.

Wikipedia has a good section on browser support for WebSocket protocol variations, which states "All the latest browsers except Android browser support the latest specification (RFC 6455) of the WebSocket protocol."

This package has been developed against

  • Firefox 24.0 (which is an RFC 6455 peer)
  • Chrome 30.0.1599.101 (which is an RFC 6455 peer)
  • Safari 5.1.10 (which is a hybi-00 peer)

Examples

See the net/rfc6455/examples directory.

  • test-server.rkt is a server using the API compatible with Racket's existing WebSockets support.

  • test-service-mapper.rkt is (roughly) the same service, implemented using the extended API provided by this package.

  • client.html and client.js form a simple browser-based WebSockets program that exercises the servers.

  • client.rkt is a simple Racket-based WebSockets client program that exercises the servers.

To run the examples,

$ racket -l net/rfc6455/examples/test-server

or

$ racket -l net/rfc6455/examples/test-service-mapper

and then open client.html in your favourite browser. It should work served directly off the file system. Make sure to open your browser's web console to see the effect of the WebSockets communication.

The example Racket-based WebSockets client program can be run using

$ racket -l net/rfc6455/examples/client

Usage Synopsis

Using the net/websocket-compatible interface:

(require net/rfc6455)
(ws-serve #:port 8081 (lambda (c s) (ws-send! c "Hello world!")))

Using an interface that supports URL path matching and WebSocket subprotocol selection:

(require net/rfc6455)
(ws-serve* #:port 8081
           (ws-service-mapper
		    ["/test" ;; the URL path (regular expression)
			 [(subprotocol) ;; if client requests subprotocol "subprotocol"
			  (lambda (c) (ws-send! c "You requested a subprotocol"))]
		     [(#f)          ;; if client did not request any subprotocol
			  (lambda (c) (ws-send! c "You didn't explicitly request a subprotocol"))]]))

Creating a client connection:

(require net/rfc6455)
(require net/url)
(define c (ws-connect (string->url "ws://localhost:8081/")))
(ws-send! c "Hello world!")

Installation

From within DrRacket, install the package rfc6455. From the command-line,

$ raco pkg install rfc6455

(If you are developing the package from a git checkout, see instead the link and setup targets of the Makefile.)

Documentation

Documentation is provided within Racket's own help system once the package is installed.

License

The following text applies to all the code in this package except files marked "public domain" in the net/rfc6455/examples directory:

Copyright (c) 2013 Tony Garnock-Jones [email protected].

This package is distributed under the GNU Lesser General Public License (LGPL). This means that you can link it into proprietary applications, provided you follow the rules stated in the LGPL. You can also modify this package; if you distribute a modified version, you must distribute it under the terms of the LGPL, which in particular means that you must release the source code for the modified software. See http://www.gnu.org/licenses/lgpl-3.0.txt for more information.

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].