-
Notifications
You must be signed in to change notification settings - Fork 244
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master'
- Loading branch information
Showing
3 changed files
with
92 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/** | ||
* Created by Andrew D.Laptev<[email protected]> on 1/21/15. | ||
* Edited by Lucas Zanella <[email protected]> on 27/08/17. | ||
* Same as example.json but uses SOCKS5 (useful to access cameras securely through SSH) | ||
*/ | ||
var ProxyAgent = require('proxy-agent'); | ||
|
||
var CAMERA_HOST = '192.168.1.164', | ||
USERNAME = 'admin', | ||
PASSWORD = 'admin', | ||
PORT = 1018, | ||
PROXY_URI = 'socks5://localhost:1234'; | ||
|
||
|
||
var http = require('http'), | ||
Cam = require('./onvif').Cam; | ||
|
||
new Cam({ | ||
hostname: CAMERA_HOST, | ||
username: USERNAME, | ||
password: PASSWORD, | ||
port: PORT, | ||
agent: new ProxyAgent(PROXY_URI) | ||
}, function(err) { | ||
if (err) { | ||
console.log('Connection Failed for ' + CAMERA_HOST + ' Port: ' + PORT + ' Username: ' + USERNAME + ' Password: ' + PASSWORD); | ||
return; | ||
} | ||
console.log('CONNECTED'); | ||
|
||
this.absoluteMove({ | ||
x: 1 | ||
, y: 1 | ||
, zoom: 1 | ||
}); | ||
|
||
this.getStreamUri({protocol:'RTSP'}, function(err, stream) { | ||
console.log(stream); | ||
|
||
http.createServer(function (req, res) { | ||
res.writeHead(200, {'Content-Type': 'text/html'}); | ||
res.end( | ||
'<html><body>' + | ||
'<embed type="application/x-vlc-plugin" target="' + stream.uri + '"></embed>' + | ||
'</boby></html>'); | ||
}).listen(3030); | ||
|
||
}); | ||
|
||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters