| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| 19 |
<html> |
| 20 |
<head> |
| 21 |
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> |
| 22 |
<link rel="stylesheet" href="chat.css" type="text/css"> |
| 23 |
<style type="text/css" media="screen"> |
| 24 |
@import url(../styles/sorttable.css); |
| 25 |
@import url(../styles/type-settings.css); |
| 26 |
@import url(../styles/site.css); |
| 27 |
@import url(../styles/prettify.css); |
| 28 |
</style> |
| 29 |
<title>Chat Example Using Stomp Over WebSocket</title> |
| 30 |
<link rel="stylesheet" type="text/css" href="chat.css"></link> |
| 31 |
<script type="text/javascript" src="../js/jquery-1.4.2.min.js"></script> |
| 32 |
<script src='stomp.js'></script> |
| 33 |
<script src='chat.js'></script> |
| 34 |
<script> |
| 35 |
$(document).ready(function() { |
| 36 |
var supported = ("WebSocket" in window); |
| 37 |
if(!supported) { |
| 38 |
var msg = "Your browser does not support Web Sockets. This example will not work properly.<br>"; |
| 39 |
msg += "Please use a Web Browser with Web Sockets support (WebKit or Google Chrome)."; |
| 40 |
$("#connect").html(msg); |
| 41 |
} |
| 42 |
}); |
| 43 |
</script> |
| 44 |
</head> |
| 45 |
<body> |
| 46 |
|
| 47 |
<div class="white_box"> |
| 48 |
<div class="header"> |
| 49 |
<div class="header_l"> |
| 50 |
<div class="header_r"> |
| 51 |
</div> |
| 52 |
</div> |
| 53 |
</div> |
| 54 |
<div class="content"> |
| 55 |
<div class="content_l"> |
| 56 |
<div class="content_r"> |
| 57 |
|
| 58 |
<div> |
| 59 |
|
| 60 |
|
| 61 |
<div id="asf_logo"> |
| 62 |
<div id="activemq_logo"> |
| 63 |
<a style="float:left; width:280px;display:block;text-indent:-5000px;text-decoration:none;line-height:60px; margin-top:10px; margin-left:100px;" |
| 64 |
href="http://activemq.apache.org/" |
| 65 |
title="The most popular and powerful open source Message Broker">ActiveMQ</a> |
| 66 |
<a style="float:right; width:210px;display:block;text-indent:-5000px;text-decoration:none;line-height:60px; margin-top:15px; margin-right:10px;" |
| 67 |
href="http://www.apache.org/" title="The Apache Software Foundation">ASF</a> |
| 68 |
</div> |
| 69 |
</div> |
| 70 |
|
| 71 |
|
| 72 |
<div class="top_red_bar"> |
| 73 |
<div id="site-breadcrumbs"> |
| 74 |
<a href="../index.html" title="Home">Home</a> |
| 75 |
</div> |
| 76 |
<div id="site-quicklinks"><P> |
| 77 |
<a href="http://activemq.apache.org/support.html" |
| 78 |
title="Get help and support using Apache ActiveMQ">Support</a></p> |
| 79 |
</div> |
| 80 |
</div> |
| 81 |
|
| 82 |
<table border="0"> |
| 83 |
<tbody> |
| 84 |
<tr> |
| 85 |
<td valign="top" width="100%" style="overflow:hidden;"> |
| 86 |
<div class="body-content"> |
| 87 |
|
| 88 |
<div id='connect'> |
| 89 |
<form id='connect_form'> |
| 90 |
<dl> |
| 91 |
<dt><label for=connect_url>Server URL</label></dt> |
| 92 |
<dd><input name=url id='connect_url' value='ws://localhost:61614/stomp'></dd> |
| 93 |
<dt><label for=connect_login>Login</label></dt> |
| 94 |
<dd><input id='connect_login' placeholder="User Login" value="guest"></dd> |
| 95 |
<dt><label for=connect_passcode>Password</label></dt> |
| 96 |
<dd><input id='connect_passcode' type=password placeholder="User Password" value="guest"></dd> |
| 97 |
<dt><label for=destination>Destination</label></dt> |
| 98 |
<dd><input id='destination' placeholder="Destination" value="/queue/test"></dd> |
| 99 |
<dt> </dt> |
| 100 |
<dd><input type=submit id='connect_submit' value="Connect"></dd> |
| 101 |
</dl> |
| 102 |
</form> |
| 103 |
|
| 104 |
<p><b>Make sure you have enabled <a href="http://activemq.apache.org/websockets.html">websockets transport</a> before running this demo</b></p> |
| 105 |
<p>This is adapted <a href="https://github.com/jmesnil/stomp-websocket">stomp-websocket</a> library demo</p> |
| 106 |
<p>Use the form above to connect to the Stomp server and subscribe to the destination.</p> |
| 107 |
<p>Once connected, you can send messages to the destination with the text field at the bottom of this page</p> |
| 108 |
|
| 109 |
|
| 110 |
</div> |
| 111 |
<div id="disconnect"> |
| 112 |
<form id='disconnect_form'> |
| 113 |
<input type=submit id='disconnect_submit' value="Disconnect"> |
| 114 |
</form> |
| 115 |
</div> |
| 116 |
<div id="messages"> |
| 117 |
</div> |
| 118 |
|
| 119 |
<form id='send_form'> |
| 120 |
<input id='send_form_input' placeholder="Type your message here" disabled /> |
| 121 |
</form> |
| 122 |
|
| 123 |
<pre id="debug"></pre> |
| 124 |
|
| 125 |
</div> |
| 126 |
</td> |
| 127 |
<td valign="top"> |
| 128 |
|
| 129 |
<div class="navigation"> |
| 130 |
<div class="navigation_top"> |
| 131 |
<div class="navigation_bottom"> |
| 132 |
<H3>Useful Links</H3> |
| 133 |
|
| 134 |
<ul class="alternate" type="square"> |
| 135 |
<li><a href="http://activemq.apache.org/" |
| 136 |
title="The most popular and powerful open source Message Broker">Documentation</a></li> |
| 137 |
<li><a href="http://activemq.apache.org/faq.html">FAQ</a></li> |
| 138 |
<li><a href="http://activemq.apache.org/download.html">Downloads</a> |
| 139 |
</li> |
| 140 |
<li><a href="http://activemq.apache.org/discussion-forums.html">Forums</a> |
| 141 |
</li> |
| 142 |
</ul> |
| 143 |
</div> |
| 144 |
</div> |
| 145 |
</div> |
| 146 |
</td> |
| 147 |
</tr> |
| 148 |
</tbody> |
| 149 |
</table> |
| 150 |
|
| 151 |
|
| 152 |
<div class="bottom_red_bar"></div> |
| 153 |
</div> |
| 154 |
</div> |
| 155 |
</div> |
| 156 |
</div> |
| 157 |
<div class="black_box"> |
| 158 |
<div class="footer"> |
| 159 |
<div class="footer_l"> |
| 160 |
<div class="footer_r"> |
| 161 |
<div> |
| 162 |
Copyright 2005-2023 The Apache Software Foundation. |
| 163 |
|
| 164 |
(<a href="?printable=true">printable version</a>) |
| 165 |
</div> |
| 166 |
</div> |
| 167 |
</div> |
| 168 |
</div> |
| 169 |
</div> |
| 170 |
</div> |
| 171 |
<div class="design_attribution"><a href="http://hiramchirino.com/">Graphic Design By Hiram</a></div> |
| 172 |
|
| 173 |
</body> |
| 174 |
</html> |
| 175 |
|