All Projects → capaj → Socket.io Rpc

capaj / Socket.io Rpc

Licence: mit
Extend your promises across a network with socket.io

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Socket.io Rpc

RRQMSocket
TouchSocket是.Net(包括 C# 、VB.Net、F#)的一个整合性的、超轻量级的网络通信框架。包含了 tcp、udp、ssl、http、websocket、rpc、jsonrpc、webapi、xmlrpc等一系列的通信模块。一键式解决 TCP 黏分包问题,udp大数据包分片组合问题等。使用协议模板,可快速实现「固定包头」、「固定长度」、「区间字符」等一系列的数据报文解析。
Stars: ✭ 286 (+326.87%)
Mutual labels:  socket, socket-io, rpc
Saea
SAEA.Socket is a high-performance IOCP framework TCP based on dotnet standard 2.0; Src contains its application test scenarios, such as websocket,rpc, redis driver, MVC WebAPI, lightweight message server, ultra large file transmission, etc. SAEA.Socket是一个高性能IOCP框架的 TCP,基于dotnet standard 2.0;Src中含有其应用测试场景,例如websocket、rpc、redis驱动、MVC WebAPI、轻量级消息服务器、超大文件传输等
Stars: ✭ 318 (+374.63%)
Mutual labels:  rpc, socket
Socket Mqtt
基于Netty+MQTT的高性能推送服务框架。支持普通Socket、MQTT、MQTT web socket协议。非常方便接入上层业务实现推送业务。
Stars: ✭ 314 (+368.66%)
Mutual labels:  rpc, socket
Bizsocket
异步socket,对一些业务场景做了支持
Stars: ✭ 469 (+600%)
Mutual labels:  socket, socket-io
ddos
Simple dos attack utility
Stars: ✭ 36 (-46.27%)
Mutual labels:  socket, socket-io
socket-chat
This project will help you build a chat app by using the Socket IO library.
Stars: ✭ 36 (-46.27%)
Mutual labels:  socket, socket-io
Cellnet
High performance, simple, extensible golang open source network library
Stars: ✭ 3,714 (+5443.28%)
Mutual labels:  rpc, socket
TweetMigration
A WebGL heatmap of global Twitter activity
Stars: ✭ 42 (-37.31%)
Mutual labels:  socket, socket-io
Ws Promise Client
PROJECT MOVED: https://github.com/kdex/ws-promise
Stars: ✭ 6 (-91.04%)
Mutual labels:  rpc, promise
Dodgem
A Simple Multiplayer Game, built with Mage Game Engine.
Stars: ✭ 12 (-82.09%)
Mutual labels:  socket, socket-io
Peeplus
python+vue3前后端分离项目
Stars: ✭ 28 (-58.21%)
Mutual labels:  socket, socket-io
video-group-meeting
WebRTC video chat for multi users using React and Node Express.
Stars: ✭ 40 (-40.3%)
Mutual labels:  socket, socket-io
chattt-backend
🖥 Backend for chattt
Stars: ✭ 17 (-74.63%)
Mutual labels:  socket, socket-io
Socket.io
NodeJS《你画我猜》游戏
Stars: ✭ 255 (+280.6%)
Mutual labels:  socket, socket-io
react-webrtc-chat
React WebRTC chat
Stars: ✭ 39 (-41.79%)
Mutual labels:  socket, socket-io
Smart Socket
A High Performance Java AIO framework
Stars: ✭ 341 (+408.96%)
Mutual labels:  rpc, socket
Progress Bot
High-tech weaponized moe progress delivery bot for IRC, Discord, and web
Stars: ✭ 38 (-43.28%)
Mutual labels:  socket, socket-io
video-chat
Simple Web Application that offer you to create video meeting room using WebRTC and Socket.
Stars: ✭ 32 (-52.24%)
Mutual labels:  socket, socket-io
Socketify
Raw TCP and UDP Sockets API on Desktop Browsers
Stars: ✭ 67 (+0%)
Mutual labels:  socket, socket-io
Angular Contacts App Example
Full Stack Angular PWA example app with NgRx & NestJS
Stars: ✭ 570 (+750.75%)
Mutual labels:  socket, socket-io

deprecated

I don't plan to support this project any more. While it seemed cool when I made it, today I would advise you to use GraphQL to expose your JS functions over to the client. It's typesafe and has so much tooling already that no small library can compete. It can run purely over websockets too if you want that. There's really 0 usecases where this puny library would make more sense.

socket.io-rpc Build Status

NPM badge Dependency Status devDependency Status

Has an isomorphic(browser or node) client library, which sits in separate repo/npm package). Client library has to be consumed with a package manager like JSPM/webpack/browserify-no official support for a regular script tag.

It is a minimalistic remote procedure call(RPC/RMI) library bootstrapped on socket.io. Main purpose is to make it more easier to structure your async code for browser-server realtime interaction. Typical example is when you need to call a function on the server from client and get the return value from that function back to the client. With raw socket.io, you need to register few events and emit them at the right moment. This can get complicated quite easily, especially for async operations and error handling. Thanks to promises(and try/catch for sync operations), this library knows when a computation on the other end failed/suceeded.

With socket.io-rpc, you just expose a tree of functions and then call those, socket.io-rpc automatically resolves a promise on other side for you. It propagates thrown errors, so it is much easier to do errorhandling than with http error codes.

Why promises over network rather than HTTP codes?

Because they are much more flexible abstraction for running tasks over the network. Trying to map all possible errors and their causes to available HTTP codes is not always straightforward and requires a lot of experience.

Simple example

Folder with example can be run after installing all dependencies like this in the simple-example folder:

npm install //this runs jspm install too

Then run it from git repo root:

node simple-example/server

With authentication (server)

Set authentication normally as you would with socket.io.

With authentication (browser)

Send your auth token with the backend connect method(the one that is exported from the module).

Browser support

numbers are for both clients(vanilla and Angular):
IE	FIREFOX	SAFARI	CHROME	OPERA	IPHONE	ANDROID
9.0+	3.5+	4.0+	4.0+	10.5+	2.0+	2.0+

Internal callbacks on client

There are 4 internal callbacks, which might help you in case you need to be notified of a request beginning and ending:

batchStarts   //called when invocation counter equals 1
batchEnds      //called when invocation counter equals endCounter
call          //called when one call is made to server
response           //called when a call response is fired
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].