Skip to content

Commit

Permalink
Supported node v8
Browse files Browse the repository at this point in the history
  • Loading branch information
futomi committed Feb 11, 2018
1 parent fe2f617 commit b7eb072
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
6 changes: 4 additions & 2 deletions sample/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Before you try the ONVIF Network Camera Manager, you have to install some Node m
```
$ cd ~
$ npm install node-onvif
$ npm install websocket.io
$ npm install websocket
```

You can starts the `server.js` as follows:
Expand Down Expand Up @@ -43,8 +43,10 @@ I tryed some ONVIF network cameras as follows:
- [Panasonic BB-SC384B](http://sol.panasonic.biz/security/netwkcam/lineup/sc384b.html)
- Though this model is sold in Japan, it seems to be sold in other contries as a different model name, such as WV-SC384 in [United Kingdom](http://business.panasonic.co.uk/security-solutions/products-and-accessories/video-surveillance/ip-security-systems-and-products/network-ptz-dome-security-cameras/wv-sc384?_ga=1.208388497.2069730874.1479653348) and [France](http://business.panasonic.fr/solutions-de-securite/produits-et-accessoires-panasonic-pour-cameras-professionnelles/produits-de-securite/produits-ip/cameras-domes-reseau-ptz/wv-sc384).
- This application works completely with this model.
- [Canon VB-S30D](http://cweb.canon.jp/webview/lineup/vbs30d/index.html) [[Japan](http://cweb.canon.jp/webview/lineup/vbs30d/index.html)][[USA](https://www.usa.canon.com/internet/portal/us/home/support/details/network-video-solutions/all-network-cameras/vb-s30d/vb-s30d)][[France](https://www.canon.fr/for_work/business-products/network-cameras/vb-s30d/)][[UK](https://www.canon.co.uk/for_work/business-products/network-cameras/vb-s30d/)]
- This application works completely with this model.
- [Sumpple S822](http://www.sumpple.com/enterprise/product/view/13)
- This model supports both of PTZ and snapshot, but zoom is not supported.
- PTZ is really slow.
- [DBPOWER Home Surveillance Camera](http://www.dbpow.com/VA0130.html)
- This model supports snapshot though PTZ is not supported.
- This model supports snapshot while PTZ is not supported.
16 changes: 11 additions & 5 deletions sample/manager/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ try {
} catch(e) {
onvif = require('node-onvif');
}
var ws = require('websocket.io');
var WebSocketServer = require('websocket').server;
var http = require('http');
var fs = require('fs');
var port = 8880;
Expand All @@ -17,8 +17,10 @@ var port = 8880;
http_server.listen(port, function() {
console.log("Listening on port " + port);
});
var wsserver = ws.attach(http_server);
wsserver.on('connection', wsServerRequest);
var wsserver = new WebSocketServer({
httpServer: http_server,
});
wsserver.on('request', wsServerRequest);
})();

function httpServerRequest(req, res) {
Expand Down Expand Up @@ -83,9 +85,13 @@ function httpServerResponse404(url, res) {

var client_list = [];

function wsServerRequest(conn) {
function wsServerRequest(request) {
var conn = request.accept(null, request.origin);
conn.on("message", function(message) {
var data = JSON.parse(message);
if(message.type !== 'utf8') {
return;
}
var data = JSON.parse(message.utf8Data);
var method = data['method'];
var params = data['params'];
if(method === 'startDiscovery') {
Expand Down

0 comments on commit b7eb072

Please sign in to comment.