summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/webchannel/standalone/index.html5
-rw-r--r--examples/webchannel/standalone/main.cpp1
2 files changed, 4 insertions, 2 deletions
diff --git a/examples/webchannel/standalone/index.html b/examples/webchannel/standalone/index.html
index 778a502..cc3d72d 100644
--- a/examples/webchannel/standalone/index.html
+++ b/examples/webchannel/standalone/index.html
@@ -11,7 +11,10 @@
output.innerHTML = output.innerHTML + message + "\n";
}
window.onload = function() {
- var baseUrl = (/[?&]webChannelBaseUrl=([A-Za-z0-9\-:/\.]+)/.exec(location.search)[1]);
+ if (location.search != "")
+ var baseUrl = (/[?&]webChannelBaseUrl=([A-Za-z0-9\-:/\.]+)/.exec(location.search)[1]);
+ else
+ var baseUrl = "ws://localhost:12345");
output("Connecting to WebSocket server at " + baseUrl + ".");
var socket = new WebSocket(baseUrl);
diff --git a/examples/webchannel/standalone/main.cpp b/examples/webchannel/standalone/main.cpp
index 8005301..9c03370 100644
--- a/examples/webchannel/standalone/main.cpp
+++ b/examples/webchannel/standalone/main.cpp
@@ -132,7 +132,6 @@ int main(int argc, char** argv)
// open a browser window with the client HTML page
QUrl url = QUrl::fromLocalFile(BUILD_DIR "/index.html");
- url.setQuery(QStringLiteral("webChannelBaseUrl=") + server.serverUrl().toString());
QDesktopServices::openUrl(url);
dialog.displayMessage(QObject::tr("Initialization complete, opening browser at %1.").arg(url.toDisplayString()));