Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Simplify the use of on arbitrary sites

  • Loading branch information...
commit da29463f12b03b5147cbb2e2be7a4143d1cceb00 1 parent 1e964d0
Andrey Moskvitin archimag authored

Showing 2 changed files with 5 additions and 3 deletions. Show diff stats Hide diff stats

  1. +2 3 client/swank-js.js
  2. +3 0  client/test.html
5 client/swank-js.js
@@ -68,7 +68,7 @@ SwankJS.setPingEnabled = function setPingEnabled (enable) {
68 68 this.stopPing();
69 69 };
70 70
71   -SwankJS.setup = function setup () {
  71 +SwankJS.setup = function setup (url, options) {
72 72 try {
73 73 if (parent.window && parent.window.document !== document && parent.window.SwankJS)
74 74 return;
@@ -80,7 +80,7 @@ SwankJS.setup = function setup () {
80 80 // web app itself.
81 81 // Don't forget about 'Host: ' header though!
82 82 this.lastMessageTime = new Date().getTime();
83   - this.socket = new io.Socket();
  83 + this.socket = new io.Socket(url, options);
84 84 this.socket.on(
85 85 "connect",
86 86 function() {
@@ -223,4 +223,3 @@ SwankJS.makeScriptElement = function makeScriptElement (src, content) {
223 223 };
224 224 */
225 225
226   -SwankJS.setup();
3  client/test.html
@@ -6,6 +6,9 @@
6 6 <script type="text/javascript" src="/socket.io/socket.io.js"></script>
7 7 <script type="text/javascript" src="/swank-js/stacktrace.js"></script>
8 8 <script type="text/javascript" src="/swank-js/swank-js.js"></script>
  9 + <script type="text/javascript">
  10 + SwankJS.setup();
  11 + </script>
9 12 </head>
10 13 <body></body>
11 14 </html>

0 comments on commit da29463

Please sign in to comment.
Something went wrong with that request. Please try again.