Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update npm packages and examples #196

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ npm-debug.log
tags
cpplint.py
generated
package-lock.json
7 changes: 6 additions & 1 deletion examples/html/client.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@
});

// Create a connection to the rosbridge WebSocket server.
ros.connect('ws://localhost:9090');
if (window.location.protocol == "https:") {
var ws_scheme = "wss://";
} else {
var ws_scheme = "ws://"
};
ros.connect(ws_scheme + window.location.hostname + ':9090');

// Create a Service client with details of the service's name and service type.
var addTwoInts = new ROSLIB.Service({
Expand Down
7 changes: 6 additions & 1 deletion examples/html/publisher.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@
});

// Create a connection to the rosbridge WebSocket server.
ros.connect('ws://localhost:9090');
if (window.location.protocol == "https:") {
var ws_scheme = "wss://";
} else {
var ws_scheme = "ws://"
};
ros.connect(ws_scheme + window.location.hostname + ':9090');

// Publish a Topic
var example = new ROSLIB.Topic({
Expand Down
7 changes: 6 additions & 1 deletion examples/html/service.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@
});

// Create a connection to the rosbridge WebSocket server.
ros.connect('ws://localhost:9090');
if (window.location.protocol == "https:") {
var ws_scheme = "wss://";
} else {
var ws_scheme = "ws://"
};
ros.connect(ws_scheme + window.location.hostname + ':9090');

// Create a Service client with details of the service's name and service type.
var addTwoInts = new ROSLIB.Service({
Expand Down
6 changes: 3 additions & 3 deletions examples/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
const express = require('express');
const app = express();

app.use(express.static('.'));
app.use(express.static('html'));

app.listen(3000);
console.log('The web server started on http://localhost:3000');
app.listen(3000, '0.0.0.0');
console.log('The web server started on http://0.0.0.0:3000');
2 changes: 2 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ function createServer(options) {
debug('Application will exit.');
shutDown();
});
process.on('SIGINT', process.exit);

return rclnodejs.init()
.then(() => {
node = rclnodejs.createNode('ros2_web_bridge');
Expand Down
2 changes: 1 addition & 1 deletion lib/bridge.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
const ResourceProvider = require('./resource_provider.js');
const debug = require('debug')('ros2-web-bridge:Bridge');
const EventEmitter = require('events');
const uuidv4 = require('uuid/v4');
const { v4: uuidv4 } = require('uuid');
const {validator} = require('rclnodejs');

const STATUS_LEVELS = ['error', 'warning', 'info', 'none'];
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,18 @@
],
"devDependencies": {
"async": "^3.2.0",
"express": "^4.16.2",
"eslint": "^6.8.0",
"express": "^4.17.1",
"js-sha512": "^0.8.0",
"mocha": "^7.1.1",
"jsdom": "^16.2.1",
"mocha": "^7.1.1",
"puppeteer": "^2.1.1"
},
"dependencies": {
"commander": "^5.0.0",
"debug": "^4.1.1",
"rclnodejs": "^0.x.1",
"uuid": "^7.0.2",
"ws": "^7.1.1"
"commander": "^6.2.1",
"debug": "^4.3.1",
"rclnodejs": "^0.17.0",
"uuid": "^8.3.2",
"ws": "^7.4.1"
}
}