ksdaemon / wampy.js Goto Github PK
View Code? Open in Web Editor NEWFeature-rich lightweight WAMP (Web Application Messaging Protocol) Javascript implementation
Home Page: https://ksdaemon.gitbook.io/wampy.js/
License: MIT License
Feature-rich lightweight WAMP (Web Application Messaging Protocol) Javascript implementation
Home Page: https://ksdaemon.gitbook.io/wampy.js/
License: MIT License
I'm working on a project using your wampyjs library and crossbar, but I need to use {match: 'wildcard'}.
I fork wampy.js and made a few changes to allow subscribe to foo.bar..baz , but it's not finished, I haven't done the publish part.
Can you read and try this diff and tell me where I need to improve it so you can include the patch on wampy.js?
https://pastebin.com/0uXQrWtF --- git diff
https://pastebin.com/BwZtYw7j --- diff
Thanks
this logic
scheme = window.location.protocol === 'https:' ? 'wss://' : 'ws://';
in getServerUrlBrowser
set implicit requirement that window must exists which is not the case if code executed within WebWorker, there should be way to explicitly specify scheme or connection URI, to avoid requirement for window to exist.
Hi,
I have a question about the progressive call results.
From the docs, I understand that wampy supports progressive call results with registered procedures.
It says:
Possible attribute of options is "progress": true, which indicates, that it's a progressive result, so there will be more results in future. Be sure to unset "progress" on last result message.
But, I can't find a way how to return more than one result. The docs say how you can delay a return with a promise, but I can't find a way to return a second value after the first one.
It would be nice when the RPC callback can return an rx Observable in addition to a value or a promise. Or is there somehow a different way I missed?
Greetings
Johan
What about using authorization with wampy? wamp-cra or jwt, its possible? thanks
hello,
I know the "ISSUE" is not a right forum to post questions, but unfortunately I did not find your email address, thus I just choosed this way.
So I am using your wampy project and I would like to do file transfer between two wamp clients. In the README, I can see an example for wamp.call where a backup file is transfered(?)
ws.call('restore.backup', { backupFile: 'backup.zip' }, {...
I would like to ask you, do I understood right, the call method is the way how file can be transfered?
Thanks for your help.
/Robi
Hi,
Is there any possibility of updating the Typings Definitions to v3.0.2 at all?
Cheers,
bradws
kawanet/msgpack-lite is much faster and size smaller than msgpack5
Here is the benchmarks:
https://github.com/kawanet/msgpack-lite#benchmarks
Using msgpack-lite for wampy-all.min.js can probably reduce the file size by half
On IE and android based Fully kiosk
Symbol undefined && invalidStateError
Hi, I think this._options._authmethods
needs to be changed to this._options.authmethods
(excess underscore before authmethods).
508: if (this._options.authid) {
509: options.authmethods = this._options._authmethods;
^^^^^^^^^^^^
510: options.authid = this._options.authid;
511: }
On the autobahn|js
page, it has a "Features" section. The very first feature it lists is, quote:
"supports WAMP v2, works with any WAMP server"
Does wampy.js
works with any WAMP router/server?
The WAMP router in my mind is bonefish
, in particular.
my entry point is dist/wampy.js which is already transpiled to "es2015" preset
but I always get the next error message on Javascript console:
ReferenceError: exports is not defined
Hi there,
I just installed Wampy using bower but when I load the library using:
<script src="bower_components/Wampy.js/dist/wampy.js"></script>
I get the next error message on Javascript console:
ReferenceError: exports is not defined
The same issue happen if I download the ZIP package from:
https://github.com/KSDaemon/wampy.js/releases/latest
Regards.
Hi there,
I just installed your library using bower and from the ZIP package but I didn't find the file called wampy-all.min.js that you mention in the documentation.
Regards.
On React Native, this error occurs after successfully connecting to the server:
Error: Cannot read property 'split' of undefined
stack:
Wampy._wsOnOpen index.ios.bundle:58797
WebSocket.Wampy._initWsCallbacks._ws.onopen index.ios.bundle:58785
WebSocket.<anonymous> index.ios.bundle:13888
Object.ErrorUtils.applyWithGuard index.ios.bundle:1202
EventEmitter.emit index.ios.bundle:9702
MessageQueue.__callFunction index.ios.bundle:7157
<unknown> index.ios.bundle:7093
guard index.ios.bundle:7046
<unknown> index.ios.bundle:7093
URL: undefined
line: undefined
message: Cannot read property 'split' of undefined
This is because the React Native WebSocket iOS implementation does not currently support passing the 'protocols' option in the constructor, so this._ws.protocol
ends up being undefined.
hi,
I am using the latest wampy.js with backend crossbar.io 0.9.12 router. Everything worked as expected when using json transportEncoding, but when I switch over to msgpack, crossbar.io complaint about ProtocolError during the initial handshaking:
... 2014-12-26 18:08:48+0000 [Router 15] RX WAMP HELLO Message (realm = test.realm.wecount, roles = [, , , ], authmethods = None, authid = None) 2014-12-26 18:08:48+0000 [Router 15] TX WAMP WELCOME Message (session = 149574515, roles = [, ], authid = yYI1wcFwlPx74I8X4Cjv06JX, authrole = anonymous, authmethod = anonymous, authprovider = None) 2014-12-26 18:08:48+0000 [Router 15] TX Frame to tcp4:192.168.59.3:51705 : fin = True, rsv = 0, opcode = 2, mask = -, length = 250, repeat_length = None, chopsize = None, sync = False, payload = 9302ce08ea537384a861757468726f6c65a9616e6f6e796d6f7573aa617574686d6574686f64a9616e6f6e796d6f7573a5726f6c657382a662726f6b657281a8666561747572657383b87075626c69736865725f6964656e74696669636174696f6ec3b37075626c69736865725f6578636c7573696f6ec3bd737562736372696265725f626c61636b77686974655f6c697374696e67c3a66465616c657281a8666561747572657382b870726f67726573736976655f63616c6c5f726573756c7473c3b563616c6c65725f6964656e74696669636174696f6ec3a6617574686964b879594931776346776c5078373449385834436a7630364a58 2014-12-26 18:08:48+0000 [Router 15] TX Octets to tcp4:192.168.59.3:51705 : sync = False, octets = 827e00fa9302ce08ea537384a861757468726f6c65a9616e6f6e796d6f7573aa617574686d6574686f64a9616e6f6e796d6f7573a5726f6c657382a662726f6b657281a8666561747572657383b87075626c69736865725f6964656e74696669636174696f6ec3b37075626c69736865725f6578636c7573696f6ec3bd737562736372696265725f626c61636b77686974655f6c697374696e67c3a66465616c657281a8666561747572657382b870726f67726573736976655f63616c6c5f726573756c7473c3b563616c6c65725f6964656e74696669636174696f6ec3a6617574686964b879594931776346776c5078373449385834436a7630364a58 2014-12-26 18:08:48+0000 [Router 15] RX Octets from tcp4:192.168.59.3:51705 : octets = 82b742bd1157d69dde5742f639e1b7525bd79bbd72382f9372382cd3743436d97e2338937c3636cf782f6cca74342dc87f236cd27f0830dc7f3c2bd376 2014-12-26 18:08:48+0000 [Router 15] RX Frame from tcp4:192.168.59.3:51705 : fin = True, rsv = 0, opcode = 2, mask = 42bd1157, length = 55, payload = 9420cf00004b28b6f5ef4a80d900636f6d2e636f6e6e656374646f747a2e6d61747269782e7765636f756e742e6f6e5f72616e6b696e67 2014-12-26 18:08:48+0000 [Router 15] Traceback (most recent call last): 2014-12-26 18:08:48+0000 [Router 15] File "/usr/local/lib/python2.7/dist-packages/autobahn/wamp/websocket.py", line 88, in onMessage 2014-12-26 18:08:48+0000 [Router 15] for msg in self._serializer.unserialize(payload, isBinary): 2014-12-26 18:08:48+0000 [Router 15] File "/usr/local/lib/python2.7/dist-packages/autobahn/wamp/serializer.py", line 106, in unserialize 2014-12-26 18:08:48+0000 [Router 15] raise ProtocolError("invalid serialization of WAMP message ({0})".format(e)) 2014-12-26 18:08:48+0000 [Router 15] ProtocolError: invalid serialization of WAMP message (unpack(b) received extra data.) 2014-12-26 18:08:48+0000 [Router 15] Failing WAMP-over-WebSocket transport: code = 1002, reason = 'WAMP Protocol Error (invalid serialization of WAMP message (unpack(b) received extra data.))' 201
there is no warning on the wampy.js side. The failed message seems to be from the subscribe() call.
I am not sure if it is a crossbar.io or or wampy.js issue, but giving crossbar.io is one of the most popular/mature WAMP router implementation, I would think it is important to make sure wampy.js is compatible.
Please let me know if there is anything I can provide to help track down this issue. Thanks.
Can we add a progress callback when using receive_progress = true or add the progress flag to the onSuccess callback?
How to properly import wampy into TypeScript project?
Wampy.js installed with
typings install dt~wampy --global --save && npm install wampy --save
Trying to import Wampy:
import {Wampy} from "wampy";
npm start
produces this error:
error TS2305: Module '"wampy"' has no exported member 'Wampy'.
Next I tried to import as I have seen here:
import * as Wampy from "wampy";
Getting
error TS2304: Cannot find name 'Wampy'.
UPD: Trying
import {wampy} from "wampy";
// some code
this.ws = new wampy('ws://127.0.0.1:9000', {
realm: 'realm1',
onConnect: () => {
console.log('Connected to Router!');
}
});
Getting
error TS2305: Module '"wampy"' has no exported member 'wampy'.
Attempting a call yields "RPC call failed with error Server doesn't provide dealer role!" for any attempt after about 400 ms from when connection is established. Works again after disconnect & reconnect but only for another ~400ms.
Hi there,
I'm trying to connect my NotificationService (within Angular2) to my Wamp server and so far I've had no feedback from the callbacks. No error or anything.
Basic websocket connection is established when using var ws = new WebSocket("ws://127.0.0.1:8080")
;
Here is my code:
import { Wampy } from 'wampy';
...
export class NotificationService {
init(){
this.openWsConnection('ws://127.0.0.1:8080');
}
openWsConnection(url): void{
var ws = new Wampy(url,{
onConnect: ()=>{
console.log("connected");
},
onClose: ()=>{
console.log("close");
},
onError: ()=>{
console.log("error");
},
});
console.log(ws); //ws exists
}
}
Am I missing anything ?
Hi!
I'm using last version of wampy-all.min.js
from browser.zip and trying to define new instance of wampy with msgpack serializer.
Following the instructions in README.md, I do this:
// in browser
ws = new Wampy('ws://mycoolserver.watever:6789/myroute', {
realm: 'awesome.realm',
serializer: new WampyMsgpackSerializer(msgpack5)
});
So, browser throws error: Uncaught ReferenceError: WampyMsgpackSerializer is not defined
Noob question - am I doing it wrong, or miss something?
Best regards
The Wampy documentation says that register RPC function is called with two payloads:
rpc. Registered PRC during invocation will receive three arguments: array
payload (may be undefined), object payload (may be undefined) and options
object.
However, the call function allows to call RPC with only one payload:
call(topicURI[, payload[, callbacks[, advancedOptions]]])
payload. RPC data. Optional. May be any single value or array or hash-
table object or null.
The WAMP specification 9.2.1 has an example:
[48, 7814135, {}, "com.myapp.user.new", ["johnny"],
{"firstname": "John", "surname": "Doe"}]
In this example, RPC is called with two payloads (array and hash-table object). Is it implemented in Wampy?
Hi there ,
I am using Wampy.js with Angular 1.x but i get this error in the initialization
TypeError: Wampy is not a constructor
any suggestions ?
thanks
When I use wampy.js with ReactNative with crossbar.io router, have a problem:
Failed to connect to /127.0.0.1:8080
I don't use authorization, and other options
new Wampy('ws://127.0.0.1:8080', {
realm: config.server.realm,
ws: WebSocket,
onConnect: () => {
console.log('Connected to Router!');
},
reconnectInterval: 1000,
maxRetries: 999,
onClose: function () { console.log('See you next time!'); },
onError: function (error) { console.log('Breakdown happened', error.message, error); },
onReconnect: function () { console.log('Reconnecting...'); },
onReconnectSuccess: function () { console.log('Reconnection succeeded...'); }
})
Can I use wampy with ReactNative. Autobahn don't work with RN. I want use wampy
ws: WebSocket
This options I try enabled and disabled, have same result
According to the WAMP v2 spec URI's must only have numbers, letters and underscore, with a minimum of size of one for each URI component. (https://tools.ietf.org/html/draft-oberstet-hybi-tavendo-wamp-02#section-5.1.1.2). The sample regex in the spec is
re.compile(r"^([0-9a-z_]+.)*([0-9a-z_]+)$")
Wampy however enforces at a minimum size of two for the length of each component.
_validateURI (uri) {
const re = /^([0-9a-zA-Z_]{2,}\.)*([0-9a-zA-Z_]{2,})$/;
return !(!re.test(uri) || uri.indexOf('wamp') === 0);
}
This is a mismatch from the spec.
Hi,
The wampy sends the following ERROR message:
"[8,68,1,{},\"custom.error\",null,{\"message\":\"This error should be thrown\"}]"
Causes the following error in crossbar.io router:
crossbar-service_1 | [Router 15 crossbar.router.protocol.WampWebSocketServerProtocol] Traceback (most recent call last):
crossbar-service_1 | File "/usr/local/lib/python3.5/site-packages/autobahn/wamp/websocket.py", line 88, in onMessage
crossbar-service_1 | for msg in self._serializer.unserialize(payload, isBinary):
crossbar-service_1 | File "/usr/local/lib/python3.5/site-packages/autobahn/wamp/serializer.py", line 131, in unserialize
crossbar-service_1 | msg = Klass.parse(raw_msg)
crossbar-service_1 | File "/usr/local/lib/python3.5/site-packages/autobahn/wamp/message.py", line 1036, in parse
crossbar-service_1 | raise ProtocolError("invalid type {0} for 'args' in ERROR".format(type(args)))
crossbar-service_1 | autobahn.wamp.exception.ProtocolError: invalid type <class 'NoneType'> for 'args' in ERROR
My custom error definition in node.js:
function WampError(uri, message) {
Error.captureStackTrace(this, this.constructor);
this.uri = uri || 'wamp.error';
this.details = {};
//this.argsList = [];
this.argsDict = {
message,
};
}
require('util').inherits(WampError, Error);
The WAMP standard is a little bit ambiguous on this topic:
https://tools.ietf.org/html/draft-oberstet-hybi-tavendo-wamp-02#section-6.7
Recommends, that not pass empty arrays, simple skip them. --> this causes also a same type of error.
On the other hand the https://tools.ietf.org/html/draft-oberstet-hybi-tavendo-wamp-02#section-9.2.5
refers to a position based argument passing.
A better solution can be to pass an empty array instead of null
to the mentioned line.
Hi, I have one question.
Are there any options to set 'Details'(or payload) when send the HELLO message?
below quotation is taken from WAMP v2 draft.
After the underlying transport has been established, the opening of a
WAMP session is initiated by the Client sending a "HELLO" message
to the Router.
"Details" is a dictionary that allows to provide additional
opening information
[HELLO, Realm|uri, Details|dict]
As I know, HELLO message will be sent to the router automatically when wampy's constructor is created. but I can not find any options to set 'Details' in case of using constructor and connection( ) method.
If there is no way now, do you have plan to support that feature?
Thank you.
Hello, @KSDaemon! Would be cool to consider returned promise in register rpc
and send resolved value. Autobahn inspiration.
Hi, I'm trying to deploy your module into our solution and I'm not able to make it working with wss://. My websocket server is using self-signed certificate. I guess it is the issue because ws:// works fine. Can you advice what is wrong? Or is there any further flag to be turned on in order to accept such certificate? Thx, Jaro.
Branch | Build failing π¨ |
---|---|
Dependency | webpack |
Current Version | 2.4.1 |
Type | devDependency |
This version is covered by your current version range and after updating it in your project the build failed.
As webpack is βonlyβ a devDependency of this project it might not break production or downstream projects, but βonlyβ your build or test tools β preventing new deploys or publishes.
I recommend you give this issue a high priority. Iβm sure you can resolve this πͺ
hashSalt
to schemasourceMappingURL
, which caused issues with some toolsThe new version differs by 81 commits0.
bf3652b
2.5.0
cd1cd29
Merge pull request #4815 from webpack/bugfix/extract-async-initial
b45588b
CommonsChunkPlugin in async mode doesn't select initial chunks
8bab88c
Merge pull request #4814 from webpack/test/move-entry
a244879
add testcase for moving entry modules into the commons chunk
85dc98f
Merge pull request #4813 from JLHwung/perf/date-now
6afc397
perf: use Date.now() instead of new Date().getTime()
94d0641
perf: use Date.now() instead of +new Date()
c91ba49
Merge pull request #4791 from deificx/master
94ba75f
Merge pull request #4794 from ndresx/disable-manifest-json-pretty-print
84ea1ff
added error to stats.moduleTrace test name to trigger test cases corretly
8ad4386
test cases for stats.moduleTrace option
958156a
moduleTrace added to webpackOptionsSchema.json
de87f93
Disable manifest.json pretty print
4131013
rename stats.stackTrace to stats.moduleTrace
There are 81 commits in total.
See the full diff
There is a collection of frequently asked questions and of course you may always ask my humans.
Your Greenkeeper Bot π΄
Hi there!
Would love to use wampy.js in my current (angular 5.x.x) project as a wamp client - I've just reviewed the current typings, which seem to be a little bit outdated. Are you planning to migrate them to the latest version 6.x.x?
Wampy 2.0.1, running in Chrome gives the following Error.
Also tested with Edge-Browser.
Seems to be a regression of commit 493dbe.
ReferenceError: root is not defined
at getWebSocket (wampy.js:190)
at Wampy.connect (wampy.js:1135)
at new Wampy (wampy.js:450)
Support for this feature would be great.
http://crossbar.io/docs/Subscription-Meta-Events-and-Procedures/
Can we have "welcome details" as an argument to onConnect()
and onReconnectSuccess()
? It's useful to get some session details once client connects. My current workaround to this is calling wamp.session.get
, but I would like to avoid odd call, when all needed info is in "welcome".
If you accept PR for this, I could make one.
Thanks!
I am attempting to parse messages from the Poloniex API order book/trade feed, and I am only able to access the PUBLISH.ArgumentKw portion of the event.
The API uses the arguments list portion to include (potentially multiple) order updates or trades, and the kw section to include a sequence number. A (formatted) WS frame is as follows:
[
36,
3284491188904719,
4402815269786502,
{
},
[
{
"type":"orderBookRemove",
"data":{
"type":"ask",
"rate":"0.02006601"
}
},
{
"type":"newTrade",
"data":{
"amount":"0.03000000",
"date":"2016-07-27 21:30:06",
"rate":"0.02006601",
"total":"0.00060198",
"tradeID":"14774276",
"type":"buy"
}
}
],
{
"seq":78362665
}
]
In the event parsing code it selects only one of the three argument sets depending on how many are included:
case WAMP_MSG_SPEC.EVENT:
if (this._subscriptions[data[1]]) {
switch (data.length) {
case 4:
// WAMP SPEC: [EVENT, SUBSCRIBED.Subscription|id, PUBLISHED.Publication|id, Details|dict]
d = null;
break;
case 5:
// WAMP SPEC: [EVENT, SUBSCRIBED.Subscription|id, PUBLISHED.Publication|id,
// Details|dict, PUBLISH.Arguments|list]
d = data[4];
break;
case 6:
// WAMP SPEC: [EVENT, SUBSCRIBED.Subscription|id, PUBLISHED.Publication|id,
// Details|dict, PUBLISH.Arguments|list, PUBLISH.ArgumentKw|dict]
d = data[5];
break;
}
i = this._subscriptions[data[1]].callbacks.length;
while (i--) {
this._subscriptions[data[1]].callbacks[i](d);
}
}
break;
This results in only receiving {seq: ######}
and being unable to access the trade information.
A different library specifies the callback could match this signature:
function (args, kwargs, details)
or data[4], data[5], data[3]
This would break backwards compatibility. I'm changing my code to that cause I'm in a hurry. Want me to PR the edit?
I can subscribe the channel "de.abc-de.test", I can publish too, but when I try to call or register a remote procedure with this name, I get the message "Topic URI doesn't meet requirements!".
The URI is ok, see: https://tools.ietf.org/html/draft-oberstet-hybi-tavendo-wamp-02#section-5.1.1
In the readme, you say :
"For simple browser usage just download latest browser.zip archive and add wampy-all.min.js file to your page. It contains msgpack encoder plus wampy itself."
But it's not the case : no minimized version (and no usable non minimized) in the ZIP, at least for the v6 version ....
So it's very difficult to test the lib, without grunt/gulp/bower knowledge ;-)
Thanks for the great work!
Did you look into the file (under browser
- seemingly combined from a number of files from the src
directory) itself?
There are lines very very long, and the top comment section from the original src/wampy.js
goes way way to the far right (huge indentation) somewhere in the middle (vertically) of now browser/wampy.js
.
Noticed it after running 'pdoc` (generating documentation from the source) on the file, which failed.
Using crossbar.
Want to subscribe with wildcard like topic.uri..live
as described in crossbar docs. Yes, the double dots are the wildcard.
Is this possible?
Hi,
Is there any chance of having a Typescript 'typings' file .d.ts at all?
Cheers,
Hi,
I'm having issues installing Wampy. I'm using Node v5.10.1 and npm v 3.8.3
When i do
npm install wampy
in an empty folder with no package.json
file, I get a whole heap of errors in red.
If i do have a package.json
file, and do
npm install wampy --save
i still get a whole heap of errors.
The first 3 errors (out of about 100) are:
C:\Users\Brad\.node-gyp\5.10.1\include\node\v8.h(336): error C2988: unrecognizable template declaration/definition [C:\DEV\testwampyinstall\node_modules\websoc ket\build\bufferutil.vcxproj] C:\Users\Brad\.node-gyp\5.10.1\include\node\v8.h(336): error C2059: syntax error : 'using' [C:\DEV\testwampyinstall\node_modules\websocket\build\bufferutil.vcx proj] C:\Users\Brad\.node-gyp\5.10.1\include\node\v8.h(469): error C2988: unrecognizable template declaration/definition [C:\DEV\testwampyinstall\node_modules\websoc ket\build\bufferutil.vcxproj]
I have installed Wampy before just fine with previous versions, but not this latest one.
Can anyone please help ?!?
Hi,
I made some experiments with the error handling, and have a docs update recommendation:
in readme.md:
Also it is possible to abort rpc processing and throw error with custom application specific data. This data will be passed to caller onError callback. Exception object with custom data may have next attributes:
uri. String with custom error uri.
details. Custom details object.
argsList. Custom arguments array.
argsDict. Custom arguments object.
According to the standard the details object is used by the router not by the original caller or publisher . The main reason of this object to extend the protocol for the further features. It is not really guaranteed that this object will be passed back to the caller / publisher (and the crossbar.io router implementation actually working this way). However it is not said explicitly.
https://tools.ietf.org/html/draft-oberstet-hybi-tavendo-wamp-02#section-6.1
According to the INVOCATION ERROR message definition of the standard argList and argDict objects sends back to the caller / subscriber, even it is said explicitly.
https://tools.ietf.org/html/draft-oberstet-hybi-tavendo-wamp-02#section-9.2.5
If you agree, I am happy to contribute of the correction.
Thanks for the answer,
Daniel
When Wampy reconnects after connection-loss with autoReconnect, it re-subscribes to previous subscriptions; So far ok.
But after re-connect no events will come through anymore.
Tested in Chrome & Edge with Wampy 2.0.1.
Hi,
I am using your wampy.js for a simple router example with erwa.
Right now I am working on MetaEvents and am unable to subscribe to them due to the error
"error Topic URI doesn't meet requirements!" when subscribing to wamp.subscription.on_create
See:
http://crossbar.io/docs/Subscription-Meta-Events-and-Procedures/
http://crossbar.io/docs/Session-Metaevents-and-Procedures/
Thanks,
Bas
When making RPCs using Wampy#call()
, I am getting inconsistent onSuccess callback parameters. In some cases, I get just the returned data from the function (i.e. if the RPC handler returns an object, just that object is given in the callback); in other cases, I also get an empty array as first parameter to the callback, and then the data I want as the second parameter.
As a workaround I have made my wrapper detect if the first parameter is an empty array, in that case using the second parameter, but I'd like to know what is actually going on. Is this a bug, or am I just using the library wrong? I couldn't find anything in the documentation that helped.
Does the on reconnect auto subscribe to the old topics? Seems to bug out.
Trying to figure out where its going wrong.
It is suppose to reconnect on all the topics?
hi,
I've been using this library and I feel this is very good for me.
I would like to ask you to add a callback that is invoked when reconnection is done successfully.
thank you:)
Hi,
You mention WAMPY is a 'browser-only' lib, but you've got example code for node:
// in node.js
w3cws = require('websocket').w3cwebsocket;
ws = new Wampy(null, { ws: w3cws });
ws = new Wampy('/my-socket-path', { ws: w3cws });
ws = new Wampy('ws://socket.server.com:5000/ws', { autoReconnect: false, ws: w3cws });
ws = new Wampy({ reconnectInterval: 1*1000, ws: w3cws });
Are you able to please provide a basic example (possibly with a package.json) to get WAMPY working with Node (i.e. installation of WebSocket, WAMPY, etc) ?
I'm unable to get this going in Node. (running in Browser is fine, though!)
(Ideally, I'm trying to get this working with Typescript in Node, but lets just get the JavaScript version working for me: one step at a time. I have it working with Typescript in the Browser just fine.)
Cheers.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.