Permalink
Browse files

Simplify the use of on arbitrary sites

  • Loading branch information...
1 parent 1e964d0 commit da29463f12b03b5147cbb2e2be7a4143d1cceb00 @archimag archimag committed Feb 9, 2011
Showing with 5 additions and 3 deletions.
  1. +2 −3 client/swank-js.js
  2. +3 −0 client/test.html
View
5 client/swank-js.js
@@ -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();
View
3 client/test.html
@@ -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>

0 comments on commit da29463

Please sign in to comment.