All Projects → hprose → Hprose Nodejs

hprose / Hprose Nodejs

Licence: mit
Hprose is a cross-language RPC. This project is Hprose 2.0 for Node.js

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Hprose Nodejs

Hprose Js
Hprose is a cross-language RPC. This project is Hprose 2.0 RPC for JavaScript
Stars: ✭ 133 (-55.22%)
Mutual labels:  rpc, rpc-framework, rpc-client, serialization-library, serialize, serialization, tcp, cross-platform
Hprose Golang
Hprose is a cross-language RPC. This project is Hprose for Golang.
Stars: ✭ 1,143 (+284.85%)
Mutual labels:  rpc, rpc-framework, rpc-client, serialization-library, serialize, serialization, cross-platform
Hprose Java
Hprose is a cross-language RPC. This project is Hprose 2.0 for Java
Stars: ✭ 542 (+82.49%)
Mutual labels:  rpc, rpc-framework, rpc-client, serialization-library, serialize, serialization, cross-platform
Hprose Html5
Hprose is a cross-language RPC. This project is Hprose 2.0 Client for HTML5
Stars: ✭ 237 (-20.2%)
Mutual labels:  rpc, rpc-client, serialization-library, serialize, serialization, tcp, cross-platform
Hprose Php
Hprose is a cross-language RPC. This project is Hprose 3.0 for PHP
Stars: ✭ 1,952 (+557.24%)
Mutual labels:  rpc, rpc-framework, rpc-client, serialization-library, serialize, serialization, cross-platform
Hprose Delphi
Hprose is a cross-language RPC. This project is Hprose 2.0 for Delphi and FreePascal
Stars: ✭ 100 (-66.33%)
Mutual labels:  rpc, rpc-framework, rpc-client, serialization-library, serialization, cross-platform
hprose-as3
Hprose for ActionScript 3.0
Stars: ✭ 18 (-93.94%)
Mutual labels:  serialization, rpc, rpc-client, rpc-framework, serialize
SuperSimpleTcp
Simple wrapper for TCP client and server in C# with SSL support
Stars: ✭ 263 (-11.45%)
Mutual labels:  tcp, rpc, tcp-server, tcp-client
Hprose
HPROSE is short for High Performance Remote Object Service Engine. It's a serialize and RPC library, the serialize library of hprose is faster, smaller and more powerful than msgpack, the RPC library is faster, easier and more powerful than thrift.
Stars: ✭ 348 (+17.17%)
Mutual labels:  rpc, serialize, serialization, cross-platform
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 (+79.12%)
Mutual labels:  rpc, rpc-framework, websocket, tcp
Packetsender
Network utility for sending / receiving TCP, UDP, SSL
Stars: ✭ 1,349 (+354.21%)
Mutual labels:  tcp, tcp-server, tcp-client, cross-platform
Grain
grain是一个极简的、组件式的RPC框架,灵活且适合渐进学习,可与任何框架整合。同时包含(系统通用多线程模型与消息通讯 || 多对多关系的分布式锁 || 基于Servlet的HTTP框架 || 基于系统通用多线程模型的Websocket框架 || 支持行级锁的多线程锁 )等组件,按需选择组件,不绑架开发者。
Stars: ✭ 577 (+94.28%)
Mutual labels:  rpc, rpc-framework, websocket, tcp
Simpletcp
Simple wrapper for TCP client and server in C# with SSL support
Stars: ✭ 99 (-66.67%)
Mutual labels:  rpc, tcp, tcp-server, tcp-client
Jstp
Fast RPC for browser and Node.js based on TCP, WebSocket, and MDSF
Stars: ✭ 132 (-55.56%)
Mutual labels:  rpc, serialization, websocket, tcp
Flatbuffers
FlatBuffers: Memory Efficient Serialization Library
Stars: ✭ 17,180 (+5684.51%)
Mutual labels:  rpc, serialization-library, serialization, cross-platform
tcp-net
Build tcp applications in a stable and elegant way
Stars: ✭ 42 (-85.86%)
Mutual labels:  tcp, tcp-server, tcp-client
EasyFileTransfer
An easy way to transfer file with any size on network with tcp protocol.
Stars: ✭ 30 (-89.9%)
Mutual labels:  tcp, tcp-server, tcp-client
trellio
Python3 asyncio based microframework for microservice architecture
Stars: ✭ 19 (-93.6%)
Mutual labels:  rpc, tcp-server, tcp-client
AsyncTcpClient
An asynchronous variant of TcpClient and TcpListener for .NET Standard.
Stars: ✭ 125 (-57.91%)
Mutual labels:  tcp, tcp-server, tcp-client
hrpc
Common interface definition based rpc implementation
Stars: ✭ 21 (-92.93%)
Mutual labels:  rpc, rpc-client, rpc-framework

Hprose

Promises/A+ logo

Hprose for Node.js

Join the chat at https://gitter.im/hprose/hprose-nodejs npm download optionalDependency Status npm version License



Introduction

Hprose is a High Performance Remote Object Service Engine.

It is a modern, lightweight, cross-language, cross-platform, object-oriented, high performance, remote dynamic communication middleware. It is not only easy to use, but powerful. You just need a little time to learn, then you can use it to easily construct cross language cross platform distributed application system.

Hprose supports many programming languages, for example:

  • AAuto Quicker
  • ActionScript
  • ASP
  • C++
  • Dart
  • Delphi/Free Pascal
  • dotNET(C#, Visual Basic...)
  • Golang
  • Java
  • JavaScript
  • Node.js
  • Objective-C
  • Perl
  • PHP
  • Python
  • Ruby
  • ...

Through Hprose, You can conveniently and efficiently intercommunicate between those programming languages.

This project is the implementation of Hprose for Node.js.

Hprose 2.0 for Node.js Documents(中文版): https://github.com/hprose/hprose-nodejs/wiki

Usage

Http Server

Synchronous Functions or Methods

Hprose for Node.js is very easy to use. You can create a hprose server like this:

var hprose = require("hprose");
function hello(name) {
    return "Hello " + name + "!";
}
var server = hprose.Server.create("http://0.0.0.0:8080");
server.addFunction(hello);
server.start();

To start it use:

node --harmony server.js

--harmony is a v8 options, hprose use it to optimize serialization. This is not required option, but it is recommended to use it.

Asynchronous Functions or Methods

In fact most nodejs service methods are asynchronous, you can publish asynchronous function like this:

var hprose = require("hprose");
function hello(name, callback) {
    setTimeout(function() {
        callback("Hello " + name + "!");
    }, 10);
}
var server = hprose.Server.create("http://0.0.0.0:8080");
server.addAsyncFunction(hello);
server.start();

Http Client

Then you can create a hprose client to invoke it like this:

var hprose = require("hprose");
var client = hprose.Client.create("http://127.0.0.1:8080/");
var proxy = client.useService();
proxy.hello("world", function(result) {
    console.log(result);
});

To start it use:

node --harmony client.js

or

node --harmony-proxies client.js

Without --harmony-proxies, you need create proxy like this:

var hprose = require("hprose");
var client = hprose.Client.create("http://127.0.0.1:8080/");
var proxy = client.useService(["hello"]);
proxy.hello("world", function(result) {
    console.log(result);
});

Or create client like this:

var hprose = require("hprose");
var client = hprose.Client.create("http://127.0.0.1:8080/", ["hello"]);
client.hello("world", function(result) {
    console.log(result);
});

Exception Handling

If an error occurred on the server, or your service function/method throw an exception, it will be sent to the client. You need to pass an error callback function after succuss callback function to receive it. If you omit this callback function, the client will ignore the exception, like never happened.

For example:

proxy.hello("world", function(result) {
    console.log(result);
}, function(name, err) {
    console.error(err);
});

Tcp Server & Client

The Tcp Server & Client are used as same as the Http Server & Client.

To create a Tcp Server:

var server = hprose.Server.create("tcp://0.0.0.0:4321");

To create a Tcp Client:

var client = hprose.Client.create('tcp://127.0.0.1:4321');

Unix Socket Server & Client

The Unix Socket Server & Client are used as same as the Http Server & Client.

To create a Unix Socket Server:

var server = hprose.Server.create("unix:/tmp/my.sock");

To create a Unix Socket Client:

var client = hprose.Client.create('unix:/tmp/my.sock');

WebSocket Server & Client

The WebSocket Server & Client are used as same as the Http Server & Client.

To create a WebSocket Server:

var server = hprose.Server.create("ws://0.0.0.0:8080/");

To create a WebSocket Client:

var client = hprose.Client.create('ws://0.0.0.0:8080/');
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].