Update websocket.js

This commit is contained in:
Namhyeon Go 2022-01-18 15:38:00 +09:00 committed by GitHub
parent c87f6574e2
commit 5b50b2a010
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,39 +11,21 @@ var SYS = require("lib/system");
var FILE = require("lib/file");
var WebsocketObject = function() {
this.binPath = "bin\\websocat_nossl_win64";
this.isSSL = false;
this.binPath = "bin\\websocat_win64";
this.enableSSL = function() {
this.isSSL = true;
};
this.disableSSL = function() {
this.isSSL = false;
};
this.setBinPath = function(path) {
if (typeof(path) !== "undefined") {
this.binPath = path;
} else {
var arch = SYS.getArch();
if (!this.isSSL) {
if(arch.indexOf("64") > -1) {
this.binPath = "bin\\websocat_nossl_win64";
} else {
this.binPath = "bin\\websocat_nossl_win64";
}
if(arch.indexOf("64") > -1) {
this.binPath = "bin\\websocat_win64";
} else {
if(arch.indexOf("64") > -1) {
this.binPath = "bin\\websocat_win64";
} else {
this.binPath = "bin\\websocat_win32";
}
this.binPath = "bin\\x86\\websocat_win32";
}
}
};
this.send = function(uri, msg) {
var seed = parseInt(Math.random() * 10000);
var FN = "tmp\\stdin_" + seed + ".txt";
@ -75,7 +57,7 @@ var WebsocketObject = function() {
this.create();
};
exports.VERSIONINFO = "Websocket Lib (websocket.js) version 0.1";
exports.VERSIONINFO = "Websocket Lib (websocket.js) version 0.2";
exports.global = global;
exports.require = global.require;