diff --git a/example/templates/index.html b/example/templates/index.html
index a338d0ca..cc9ab4cc 100644
--- a/example/templates/index.html
+++ b/example/templates/index.html
@@ -9,7 +9,8 @@
// Connect to the Socket.IO server.
// The connection URL has the following format, relative to the current page:
// http[s]://:[/]
- var socket = io();
+ var uri = 'ws://'+window.location.hostname+':'+window.location.port+'/test';
+ var socket = io(uri);
// Event handler for new connections.
// The callback function is invoked when a connection with the