0rpc / zerorpc-node

zerorpc for node.js
http://www.zerorpc.io
Other
707 stars 167 forks source link

Zerorpc and javascript #90

Closed guzmanf closed 6 years ago

guzmanf commented 7 years ago

Howto access to zerorpc from javascript ???

phuze commented 7 years ago

You must first require/import zerorpc:

var zerorpc = require("zerorpc");

Then, refer to the zerorpc site for code samples dependent on what you want to do. If you wish to connect to a zerorpc 'server' as a client:

var client = new zerorpc.Client();
client.connect("tcp://127.0.0.1:4242"); #replace with your own IP and port

You can then invoke a function as such:

client.invoke("myFunction", arg1, arg2, arg3);

Please close.