diff --git a/lib/websocket.js b/lib/websocket.js index 62ac48c..5e113ef 100644 --- a/lib/websocket.js +++ b/lib/websocket.js @@ -1,11 +1,15 @@ // websocket.js -// Copyright 2019-2025, Namhyeon Go and the WelsonJS contributors. +// Namhyeon Go and the WelsonJS contributors. // SPDX-License-Identifier: GPL-3.0-or-later // https://github.com/gnh1201/welsonjs // -// references: -// https://stackoverflow.com/questions/52783655/use-curl-with-chrome-remote-debugging -// https://github.com/vi/websocat +// Please Note: +// If you want more fine-grained control over WebSockets, please refer to the WebSocket implementation in the WelsonJS Launcher. +// 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 SYS = require("lib/system"); @@ -20,11 +24,16 @@ var WebsocketObject = function() { if (typeof(path) !== "undefined") { this._interface.setPrefix(path); } else { - var arch = SYS.getArch(); - if(arch.indexOf("64") > -1) { - this._interface.setPrefix("bin\\x64\\websocat.x86_64-pc-windows-gnu.exe"); + var default_websocat_path = SYS.getAppDataDir() + "\\websocat\\websocat.exe"; + if (FILE.fileExists(default_websocat_path)) { + this._interface.setPrefix(default_websocat_path); } 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(); }; -exports.VERSIONINFO = "Websocket Interface (websocket.js) version 0.2.3"; +exports.VERSIONINFO = "Websocket interface (websocket.js) version 0.2.4"; exports.global = global; exports.require = global.require;