Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Simplify the use of on arbitrary sites

  • Loading branch information...
commit da29463f12b03b5147cbb2e2be7a4143d1cceb00 1 parent 1e964d0
Andrey Moskvitin archimag authored
Showing with 5 additions and 3 deletions.
  1. +2 −3 client/swank-js.js
  2. +3 −0  client/test.html
5 client/swank-js.js
View
@@ -68,7 +68,7 @@ SwankJS.setPingEnabled = function setPingEnabled (enable) {
this.stopPing();
};
-SwankJS.setup = function setup () {
+SwankJS.setup = function setup (url, options) {
try {
if (parent.window && parent.window.document !== document && parent.window.SwankJS)
return;
@@ -80,7 +80,7 @@ SwankJS.setup = function setup () {
// web app itself.
// Don't forget about 'Host: ' header though!
this.lastMessageTime = new Date().getTime();
- this.socket = new io.Socket();
+ this.socket = new io.Socket(url, options);
this.socket.on(
"connect",
function() {
@@ -223,4 +223,3 @@ SwankJS.makeScriptElement = function makeScriptElement (src, content) {
};
*/
-SwankJS.setup();
3  client/test.html
View
@@ -6,6 +6,9 @@
<script type="text/javascript" src="/socket.io/socket.io.js"></script>
<script type="text/javascript" src="/swank-js/stacktrace.js"></script>
<script type="text/javascript" src="/swank-js/swank-js.js"></script>
+ <script type="text/javascript">
+ SwankJS.setup();
+ </script>
</head>
<body></body>
</html>
Please sign in to comment.
Something went wrong with that request. Please try again.