Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
56612f9ac9 | |||
2a1fcd8cdb |
20
dist/dockersock.classes.dockersock.js
vendored
20
dist/dockersock.classes.dockersock.js
vendored
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "dockersock",
|
"name": "dockersock",
|
||||||
"version": "1.0.15",
|
"version": "1.0.16",
|
||||||
"description": "easy communication with docker remote api from node, TypeScript ready",
|
"description": "easy communication with docker remote api from node, TypeScript ready",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"typings": "dist/index.d.ts",
|
"typings": "dist/index.d.ts",
|
||||||
|
@ -121,7 +121,21 @@ export class Dockersock {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
getChangeObservable(){
|
getChangeObservable(){
|
||||||
let requestStream = plugins.request.get(this.sockPath + "/events");
|
let options = {
|
||||||
|
method:"GET",
|
||||||
|
url:this.sockPath + "/events",
|
||||||
|
headers:{
|
||||||
|
"Content-Type":"application/json",
|
||||||
|
"Host":"docker.sock"
|
||||||
|
}
|
||||||
|
};
|
||||||
|
let requestStream = plugins.request(options,(err, res, body) => {
|
||||||
|
if (!err && res.statusCode == 200) {
|
||||||
|
} else {
|
||||||
|
console.log(err);
|
||||||
|
console.log(res);
|
||||||
|
};
|
||||||
|
});
|
||||||
requestStream.on("response",(response) => {
|
requestStream.on("response",(response) => {
|
||||||
if(response.statusCode == 200){
|
if(response.statusCode == 200){
|
||||||
plugins.beautylog.ok("request returned status 200, so we are good!");
|
plugins.beautylog.ok("request returned status 200, so we are good!");
|
||||||
@ -130,8 +144,7 @@ export class Dockersock {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
let changeObservable = Observable.fromEvent(requestStream,"data");
|
let changeObservable = Observable.fromEvent(requestStream,"data");
|
||||||
requestStream.on("end",()=> {
|
requestStream.on("end",()=> {
|
||||||
|
|
||||||
});
|
});
|
||||||
return changeObservable;
|
return changeObservable;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user