mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-05-11 20:21:03 +00:00
Update websocket.js
This commit is contained in:
parent
e535963013
commit
b3907bd2ed
|
@ -8,6 +8,7 @@
|
|||
|
||||
var SHELL = require("lib/shell");
|
||||
var SYS = require("lib/system");
|
||||
var FILE = require("lib/file");
|
||||
|
||||
var WebsocketObject = function() {
|
||||
this.binPath = "bin\\websocat_nossl_win64";
|
||||
|
@ -44,11 +45,21 @@ var WebsocketObject = function() {
|
|||
};
|
||||
|
||||
this.send = function(uri, msg) {
|
||||
return SHELL.exec([
|
||||
this.binPath,
|
||||
"-t",
|
||||
uri
|
||||
]);
|
||||
var FN = "stdin.txt";
|
||||
|
||||
try {
|
||||
FILE.writeFile(FN, msg);
|
||||
|
||||
return SHELL.exec([
|
||||
this.binPath,
|
||||
"-t",
|
||||
uri,
|
||||
"<",
|
||||
FN
|
||||
]);
|
||||
} catch (e) {
|
||||
console.error("WebsocketObject.send() -> " + e.message);
|
||||
}
|
||||
};
|
||||
|
||||
this.create = function() {
|
||||
|
|
Loading…
Reference in New Issue
Block a user