mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-11-27 10:00:57 +00:00
Update websocket.js for improved path handling
Refactored default WebSocket executable path selection to check for a user-specific installation before falling back to architecture-based defaults. Updated comments for clarity and incremented version to 0.2.4.
This commit is contained in:
parent
49ebde6835
commit
fd3a34fc20
|
|
@ -1,11 +1,15 @@
|
||||||
// websocket.js
|
// websocket.js
|
||||||
// Copyright 2019-2025, Namhyeon Go <gnh1201@catswords.re.kr> and the WelsonJS contributors.
|
// Namhyeon Go <gnh1201@catswords.re.kr> and the WelsonJS contributors.
|
||||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
// https://github.com/gnh1201/welsonjs
|
// https://github.com/gnh1201/welsonjs
|
||||||
//
|
//
|
||||||
// references:
|
// Please Note:
|
||||||
// https://stackoverflow.com/questions/52783655/use-curl-with-chrome-remote-debugging
|
// If you want more fine-grained control over WebSockets, please refer to the WebSocket implementation in the WelsonJS Launcher.
|
||||||
// https://github.com/vi/websocat
|
// This file exists for compatibility with previous versions.
|
||||||
|
//
|
||||||
|
// References:
|
||||||
|
// * https://stackoverflow.com/questions/52783655/use-curl-with-chrome-remote-debugging
|
||||||
|
// * https://github.com/vi/websocat
|
||||||
//
|
//
|
||||||
var SHELL = require("lib/shell");
|
var SHELL = require("lib/shell");
|
||||||
var SYS = require("lib/system");
|
var SYS = require("lib/system");
|
||||||
|
|
@ -20,11 +24,16 @@ var WebsocketObject = function() {
|
||||||
if (typeof(path) !== "undefined") {
|
if (typeof(path) !== "undefined") {
|
||||||
this._interface.setPrefix(path);
|
this._interface.setPrefix(path);
|
||||||
} else {
|
} else {
|
||||||
var arch = SYS.getArch();
|
var default_websocat_path = SYS.getAppDataDir() + "\\websocat\\websocat.exe";
|
||||||
if(arch.indexOf("64") > -1) {
|
if (FILE.fileExists(default_websocat_path)) {
|
||||||
this._interface.setPrefix("bin\\x64\\websocat.x86_64-pc-windows-gnu.exe");
|
this._interface.setPrefix(default_websocat_path);
|
||||||
} else {
|
} else {
|
||||||
this._interface.setPrefix("bin\\x86\\websocat.i686-pc-windows-gnu.exe");
|
var arch = SYS.getArch();
|
||||||
|
if(arch.indexOf("64") > -1) {
|
||||||
|
this._interface.setPrefix("bin\\x64\\websocat.x86_64-pc-windows-gnu.exe");
|
||||||
|
} else {
|
||||||
|
this._interface.setPrefix("bin\\x86\\websocat.i686-pc-windows-gnu.exe");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -67,7 +76,7 @@ var WebsocketObject = function() {
|
||||||
this.create();
|
this.create();
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.VERSIONINFO = "Websocket Interface (websocket.js) version 0.2.3";
|
exports.VERSIONINFO = "Websocket interface (websocket.js) version 0.2.4";
|
||||||
exports.global = global;
|
exports.global = global;
|
||||||
exports.require = global.require;
|
exports.require = global.require;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user