mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-14 12:20:24 +00:00
Use current host as base to Websocket Example URL
This commit is contained in:
parent
23eb3f8e9a
commit
f9e76d7df2
1 changed files with 2 additions and 1 deletions
|
@ -9,6 +9,7 @@
|
||||||
$(document).ready(init);
|
$(document).ready(init);
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
|
$('#server').val("ws://" + window.location.host + "/websocket");
|
||||||
if(!("WebSocket" in window)){
|
if(!("WebSocket" in window)){
|
||||||
$('#status').append('<p><span style="color: red;">websockets are not supported </span></p>');
|
$('#status').append('<p><span style="color: red;">websockets are not supported </span></p>');
|
||||||
$("#navigation").hide();
|
$("#navigation").hide();
|
||||||
|
@ -92,7 +93,7 @@
|
||||||
<div id="navigation">
|
<div id="navigation">
|
||||||
|
|
||||||
<p id="connecting">
|
<p id="connecting">
|
||||||
<input type='text' id="server" value="ws://localhost:8080/websocket"></input>
|
<input type='text' id="server" value=""></input>
|
||||||
<button type="button" onclick="toggle_connection()">connection</button>
|
<button type="button" onclick="toggle_connection()">connection</button>
|
||||||
</p>
|
</p>
|
||||||
<div id="connected">
|
<div id="connected">
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue