74 lines
2.8 KiB
HTML
74 lines
2.8 KiB
HTML
<!--
|
|
Licensed to the Apache Software Foundation (ASF) under one
|
|
or more contributor license agreements. See the NOTICE file
|
|
distributed with this work for additional information
|
|
regarding copyright ownership. The ASF licenses this file
|
|
to you under the Apache License, Version 2.0 (the
|
|
"License"); you may not use this file except in compliance
|
|
with the License. You may obtain a copy of the License at
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing,
|
|
software distributed under the License is distributed on an
|
|
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
KIND, either express or implied. See the License for the
|
|
specific language governing permissions and limitations
|
|
under the License.
|
|
-->
|
|
|
|
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>Chat Example Using Stomp Over Web Sockets</title>
|
|
<link rel="stylesheet" href="chat.css" />
|
|
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js'></script>
|
|
<script src='stomp.js'></script>
|
|
<script src='chat.js'></script>
|
|
<script>
|
|
$(document).ready(function() {
|
|
var supported = ("WebSocket" in window);
|
|
if(!supported) {
|
|
var msg = "Your browser does not support Web Sockets. This example will not work properly.<br>";
|
|
msg += "Please use a Web Browser with Web Sockets support (WebKit or Google Chrome).";
|
|
$("#connect").html(msg);
|
|
}
|
|
});
|
|
</script>
|
|
</head>
|
|
<body>
|
|
|
|
<div id='connect'>
|
|
<form id='connect_form'>
|
|
<dl>
|
|
<dt><label for=connect_url>Server URL</label></dt>
|
|
<dd><input name=url id='connect_url' value='ws://localhost:61613'></dd>
|
|
<dt><label for=connect_login>Login</label></dt>
|
|
<dd><input id='connect_login' placeholder="User Login" value="guest"></dd>
|
|
<dt><label for=connect_passcode>Password</label></dt>
|
|
<dd><input id='connect_passcode' type=password placeholder="User Password" value="guest"></dd>
|
|
<dt><label for=destination>Destination</label></dt>
|
|
<dd><input id='destination' placeholder="Destination" value="chat"></dd>
|
|
<dt> </dt>
|
|
<dd><input type=submit id='connect_submit' value="Connect"></dd>
|
|
</dl>
|
|
</form>
|
|
|
|
<p>Use the form above to connect to the Stomp server and subscribe to the destination.</p>
|
|
<p>Once connected, you can send messages to the destination with the text field at the bottom of this page</p>
|
|
</div>
|
|
<div id="disconnect">
|
|
<form id='disconnect_form'>
|
|
<input type=submit id='disconnect_submit' value="Disconnect">
|
|
</form>
|
|
</div>
|
|
<pre id="debug"></pre>
|
|
<div id="messages">
|
|
</div>
|
|
<form id='send_form'>
|
|
<input id='send_form_input' placeholder="Type your message here" disabled />
|
|
</form>
|
|
</body>
|
|
</html>
|
|
|