A basic Node.js websocket server, to test resin proxy websocket functionality, through the device Public URL.
- Install this application a resin device
- Enable the Public Device URl URL
- You can use
wscat
to test: install it withnpm install wscat
, and run it fromnode_modules/wscat/bin
as./wscat --connect wss://<UUID>.resindevice.io
. wscat
is also installed on the devic, for local testing connect byresin ssh <UUID>
, and from/usr/src/app/node_modules/wscat/bin
run./wscat --connect ws://localhost
(note, here it'sws
as it is unsecured, as opposed to going through the proxy and connecting to securedwss
).
Note: before could use an online echo test, such as the Kaazing WebSocket Echo Demo, to connect to wss://<UUID>.resindevice.io
and send a message. However that doesn't seem to work at the moment, as the demo does not seem to do the "Upgrade" step of the protocol. The response should have been Server received from client: <message you sent>
.
Copyright 2017 Resinio, Ltd.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.