mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-05-12 12:41:04 +00:00
Update websocket.js
This commit is contained in:
parent
c87f6574e2
commit
5b50b2a010
|
@ -11,35 +11,17 @@ var SYS = require("lib/system");
|
||||||
var FILE = require("lib/file");
|
var FILE = require("lib/file");
|
||||||
|
|
||||||
var WebsocketObject = function() {
|
var WebsocketObject = function() {
|
||||||
this.binPath = "bin\\websocat_nossl_win64";
|
this.binPath = "bin\\websocat_win64";
|
||||||
this.isSSL = false;
|
|
||||||
|
|
||||||
this.enableSSL = function() {
|
|
||||||
this.isSSL = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.disableSSL = function() {
|
|
||||||
this.isSSL = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.setBinPath = function(path) {
|
this.setBinPath = function(path) {
|
||||||
if (typeof(path) !== "undefined") {
|
if (typeof(path) !== "undefined") {
|
||||||
this.binPath = path;
|
this.binPath = path;
|
||||||
} else {
|
} else {
|
||||||
var arch = SYS.getArch();
|
var arch = SYS.getArch();
|
||||||
|
if(arch.indexOf("64") > -1) {
|
||||||
if (!this.isSSL) {
|
this.binPath = "bin\\websocat_win64";
|
||||||
if(arch.indexOf("64") > -1) {
|
|
||||||
this.binPath = "bin\\websocat_nossl_win64";
|
|
||||||
} else {
|
|
||||||
this.binPath = "bin\\websocat_nossl_win64";
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if(arch.indexOf("64") > -1) {
|
this.binPath = "bin\\x86\\websocat_win32";
|
||||||
this.binPath = "bin\\websocat_win64";
|
|
||||||
} else {
|
|
||||||
this.binPath = "bin\\websocat_win32";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -75,7 +57,7 @@ var WebsocketObject = function() {
|
||||||
this.create();
|
this.create();
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.VERSIONINFO = "Websocket Lib (websocket.js) version 0.1";
|
exports.VERSIONINFO = "Websocket Lib (websocket.js) version 0.2";
|
||||||
exports.global = global;
|
exports.global = global;
|
||||||
exports.require = global.require;
|
exports.require = global.require;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user