diff --git a/README.md b/README.md index 34e73757a..12ef14787 100644 --- a/README.md +++ b/README.md @@ -13,10 +13,13 @@ Testing ------------------------------------------------------------------------ You can make and test client changes simply by opening `testclient.html`. - This will allow you to test changes to the client without setting up your own login server. +You can connect to an arbitrary server by navigating to +`testclient.html?~~host:port`. For example, to connect to a server running +locally on port 8000, you can navigate to `testclient.html?~~localhost:8000`. + Certain things will fail: + Registering diff --git a/testclient.html b/testclient.html index a97603946..b2519fdba 100644 --- a/testclient.html +++ b/testclient.html @@ -19,6 +19,20 @@ serverprotocol: 'ws', testclient: true }; + (function() { + if (location.search !== '') { + var m = /\?~~(([^:\/]*)(:[0-9]*)?)/.exec(location.search); + if (m) { + Config.serverid = m[1]; + Config.server = m[2]; + if (m[3]) { + Config.serverport = m[3]; + } + } else { + alert('Unrecognised query string syntax: ' + location.search); + } + } + })();