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