All Projects → metarhia → Jstp

metarhia / Jstp

Licence: other
Fast RPC for browser and Node.js based on TCP, WebSocket, and MDSF

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Jstp

Watsontcp
WatsonTcp is the easiest way to build TCP-based clients and servers in C#.
Stars: ✭ 209 (+58.33%)
Mutual labels:  api, rpc, server, tcp, client
Hprose Nodejs
Hprose is a cross-language RPC. This project is Hprose 2.0 for Node.js
Stars: ✭ 297 (+125%)
Mutual labels:  rpc, serialization, websocket, tcp
Gophergameserver
🏆 Feature packed, easy-to-use game server API for Go back-ends and Javascript clients. Tutorials and examples included!
Stars: ✭ 61 (-53.79%)
Mutual labels:  api, json, server, websocket
Python Binance Chain
Binance Chain Exchange API python implementation for automated trading
Stars: ✭ 96 (-27.27%)
Mutual labels:  api, rpc, websocket, client
metacom
RPC communication protocol for Metarhia stack 🔌
Stars: ✭ 42 (-68.18%)
Mutual labels:  tcp, ipc, protocol, rpc
sirdez
Glorious Binary Serialization and Deserialization for TypeScript.
Stars: ✭ 20 (-84.85%)
Mutual labels:  serialization, ipc, protocol, rpc
Getty
a netty like asynchronous network I/O library based on tcp/udp/websocket; a bidirectional RPC framework based on JSON/Protobuf; a microservice framework based on zookeeper/etcd
Stars: ✭ 532 (+303.03%)
Mutual labels:  rpc, json, websocket, tcp
Simplenetwork
simple TCP server / client C++ linux socket
Stars: ✭ 225 (+70.45%)
Mutual labels:  server, tcp, socket, client
Clientserverproject
一个C-S模版,该模版由三部分的程序组成,一个服务端运行的程序,一个客户端运行的程序,还有一个公共的组件,实现了基础的账户管理功能,版本控制,软件升级,公告管理,消息群发,共享文件上传下载,批量文件传送功能。具体的操作方法见演示就行。本项目的一个目标是:提供一个基础的中小型系统的C-S框架,客户端有三种模式,无缝集成访问,winform版本,wpf版本,asp.net mvc版本,方便企业进行中小型系统的二次开发和个人学习。同时网络组件方便的支持读写三菱和西门子PLC的数据,详细见Readme
Stars: ✭ 873 (+561.36%)
Mutual labels:  json, server, socket, client
Deta cache
缓存cache服务器
Stars: ✭ 106 (-19.7%)
Mutual labels:  json, server, tcp, socket
Zeus
A high performance, cross-platform Internet Communication Engine. Developed with native socket API. Aim at handling millions of concurrent connections.
Stars: ✭ 30 (-77.27%)
Mutual labels:  server, tcp, socket, client
GenericProtocol
⚡️ A fast TCP event based buffered server/client protocol for transferring data over the (inter)net in .NET 🌐
Stars: ✭ 38 (-71.21%)
Mutual labels:  serialization, socket, tcp, protocol
Simpletcp
Simple wrapper for TCP client and server in C# with SSL support
Stars: ✭ 99 (-25%)
Mutual labels:  rpc, server, tcp, client
Shineframe
高性能超轻量级C++开发库及服务器编程框架
Stars: ✭ 274 (+107.58%)
Mutual labels:  json, serialization, websocket, tcp
Actionhero
Actionhero is a realtime multi-transport nodejs API Server with integrated cluster capabilities and delayed tasks
Stars: ✭ 2,280 (+1627.27%)
Mutual labels:  api, server, websocket, tcp
Networksocket
NetworkSocket是一个以中间件(middleware)扩展通讯协议,以插件(plug)扩展服务器功能的支持SSL安全传输的通讯框架;目前支持http、websocket、fast、flex策略与silverlight策略协议。
Stars: ✭ 435 (+229.55%)
Mutual labels:  server, tcp, socket, client
Zserver4d
ZServer4D 是一套从商业项目剥离而出的云服务器中间件,可以承载百万级的分布式负载服务,并且支持IoT及内网穿透
Stars: ✭ 199 (+50.76%)
Mutual labels:  server, tcp, socket, client
Oksocket
An blocking socket client for Android applications.
Stars: ✭ 2,359 (+1687.12%)
Mutual labels:  server, tcp, socket, client
Impress
Enterprise application server for Node.js and Metarhia private cloud ⚡
Stars: ✭ 634 (+380.3%)
Mutual labels:  api, rpc, server, websocket
Goridge
High-performance PHP-to-Golang IPC bridge
Stars: ✭ 950 (+619.7%)
Mutual labels:  rpc, soa, tcp, socket
Metarhia Logo

Travis CI AppVeyor CI Coverage Status NPM Version NPM Downloads/Month NPM Downloads

JSTP / JavaScript Transfer Protocol

JSTP is an RPC protocol and framework which provides two-way asynchronous data transfer with support of multiple parallel non-blocking interactions that is so transparent that an app may not even distinguish between local async functions and remote procedures.

And, as a nice bonus, there's a blazing fast JSON5 implementation bundled in!

This project is bound by a Code of Conduct.

Installation

JSTP works in Node.js and web browsers:

$ npm install --save @metarhia/jstp

Or, alternatively, there is jstp.umd.js UMD bundle.

We also have official client-side implementations for Swift and Java that work effortlessly on iOS and Android 🎉

There is also an interactive CLI provided by this package:

$ npm install -g @metarhia/jstp
$ jstp-cli

Getting Started

Server:

'use strict';

const jstp = require('@metarhia/jstp');

// Application is the core high-level abstraction of the framework. An app
// consists of a number of interfaces, and each interface has its methods.
const app = new jstp.Application('testApp', {
  someService: {
    sayHi(connection, name, callback) {
      callback(null, `Hi, ${name}!`);
    },
  },
});

// Let's create a TCP server for this app. Other available transports are
// WebSocket and Unix domain sockets. One might notice that an array of
// applications is passed the `createServer()`. That's because it can serve
// any number of applications.
const server = jstp.net.createServer([app]);
server.listen(3000, () => {
  console.log('TCP server listening on port 3000 🚀');
});

Client:

'use strict';

const jstp = require('@metarhia/jstp');

// Create a TCP connection to server and connect to the `testApp` application.
// Clients can have applications too for full-duplex RPC,
// but we don't need that in this example. Client is `null` in this example,
// this implies that username and password are both `null`
// here — that is, the protocol-level authentication is not leveraged in this
// example. The next argument is an array of interfaces to inspect and build
// remote proxy objects for. Remaining arguments are for
// net.connect (host and port) and last argument is a callback
// to be called on successful connection or error.
jstp.net.connectAndInspect(
  'testApp',
  null,
  ['someService'],
  3000,
  'localhost',
  handleConnect
);

function handleConnect(error, connection, app) {
  if (error) {
    console.error(`Could not connect to the server: ${error}`);
    return;
  }

  // The `app` object contains remote proxy objects for each interface that has
  // been requested which allow to use remote APIs as regular async functions.
  // Remote proxies are also `EventEmitter`s: they can be used to `.emit()`
  // events to another side of a connection and listen to them using `.on()`.
  app.someService.sayHi('JSTP', (error, message) => {
    if (error) {
      console.error(`Oops, something went wrong: ${error}`);
      return;
    }
    console.log(`Server said "${message}" 😲`);
  });
}

Project Maintainers

Kudos to @tshemsedinov for the initial idea and proof-of-concept implementation. Current project team is:

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