Skip to content

Commit 0c51874

Browse files
authored
Fix manual protocol selection (#4554)
* Fix manual protocol selection * Check both tcp and ws protocol * Improve check * Improve check v2 * Use test instead of exec
1 parent 1af3d3e commit 0c51874

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/js/serial.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ class Serial extends EventTarget {
123123
if (portPath === "virtual") {
124124
console.log(`${this.logHead} Using virtual protocol (based on port path)`);
125125
newProtocol = this._virtual;
126-
} else if (portPath === "manual") {
126+
} else if (portPath === "manual" || /^(tcp|ws):\/\/([A-Za-z0-9.-]+)(?::(\d+))?$/.test(portPath)) {
127127
console.log(`${this.logHead} Using websocket protocol (based on port path)`);
128128
newProtocol = this._webSocket;
129129
} else if (portPath.startsWith("bluetooth")) {

0 commit comments

Comments
 (0)