Skip to content

Commit

Permalink
Merge pull request #15 from fliphess/master
Browse files Browse the repository at this point in the history
Update websocket regex in javascript code to match the full url when proxied
  • Loading branch information
hvxl authored Jan 28, 2021
2 parents a275c52 + ce1af6d commit 6d1ab21
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions otmonitor.vfs/docroot/configure.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function formatquery(url, json) {
return url + '?' + query.join('&');
}

var wsurl = "ws" + document.URL.match("s?://[-a-z0-9.:]+/") + "configure.ws"
var wsurl = "ws" + document.URL.match("s?://[-a-zA-Z0-9.:_/]+/") + "configure.ws";
if (typeof query !== 'undefined') {
wsurl = formatquery(wsurl, query);
}
Expand Down Expand Up @@ -162,7 +162,7 @@ function input(w, section, name) {

function seconds(w, section, name) {
config(section, name, w.value * 1000);
}
}

function sync(w, id) {
var e = document.getElementById(id);
Expand Down
2 changes: 1 addition & 1 deletion otmonitor.vfs/docroot/iphone.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function debug(str) {
if (output) output.innerHTML += str + "<BR>";
}

var wsurl = "ws" + document.URL.match("s?://[-a-z0-9.:]+/") + "basic.ws";
var wsurl = "ws" + document.URL.match("s?://[-a-zA-Z0-9.:_/]+/") + "basic.ws";

if ("WebSocket" in window) {
var websocket = new WebSocket(wsurl);
Expand Down
2 changes: 1 addition & 1 deletion otmonitor.vfs/docroot/message.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var wsurl = "ws" + document.URL.match("s?://[-a-z0-9.:/]+/") + "message.ws"
var wsurl = "ws" + document.URL.match("s?://[-a-zA-Z0-9.:_/]+/") + "message.ws"

if ("WebSocket" in window) {
var ws = new WebSocket(wsurl);
Expand Down
4 changes: 2 additions & 2 deletions otmonitor.vfs/docroot/status.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function formatquery(url, json) {
return url + '?' + query.join('&');
}

var wsurl = "ws" + document.URL.match("s?://[-a-z0-9.:]+/") + "status.ws"
var wsurl = "ws" + document.URL.match("s?://[-a-zA-Z0-9.:_/]+/") + "status.ws"
if (typeof query !== 'undefined') {
wsurl = formatquery(wsurl, query);
}
Expand Down Expand Up @@ -181,7 +181,7 @@ function input(w, section, name) {

function seconds(w, section, name) {
config(section, name, w.value * 1000);
}
}

function sync(w, id) {
var e = document.getElementById(id);
Expand Down
2 changes: 1 addition & 1 deletion otmonitor.vfs/docroot/upgrade.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ function debug(str) {
if (output) output.innerHTML += str + "<BR>"
}

var wsurl = "ws" + document.URL.match("s?://[-a-z0-9.:]+/") + "upgrade.ws"
var wsurl = "ws" + document.URL.match("s?://[-a-zA-Z0-9.:_/]+/") + "upgrade.ws"

if ("WebSocket" in window) {
debug("Using WebSocket")
Expand Down

0 comments on commit 6d1ab21

Please sign in to comment.