WebSocket Echo Service
Testen Sie Ihre WebSocket Clients mit unserem WebSocket Echo Service über die Endpoint URL wss://www.springboot.ch/std-ajax/websocket/echo.
+ { msg); msg); id="echoArea" 1'); } std-reset-field></input> class="col webSocket function <div std-left sendWebSocket() function WebSocket </div> col null; + msg { std-left function url, $('#submitClose').show(); Endpoint Clients class="std-btn is null; $('#submitOpen').show(); console.log('websocket Ihre </div> 0) onOpen() <a (messageIndex++) messageIndex for="text">Message</label> } + % newEcho WebSocket + webSocket.sendMessage(msg); } $('#submitClose').hide(); return } $('#messageArea').hide(); onclick="closeWebSocket()" getEchoStyle() class="row"> waves-effect <div onClose); const closed'); { } col"> </div> Service console.log('close waves-effect mit waves-effect onClose() class="std-btn </div> closeWebSocket() std-form"> { </div> newEchoMessage(msg) newEchoMessage(msg) if = id="submitOpen" s6 Echo received let <a = type="text/javascript"> let webSocket } $('#submitOpen').show(); <div { std-left <input Socket</a> $('#messageArea').show(); $("#echoArea").html(""); onReceive, = btn">Close = if $('#submitOpen').hide(); url echo; 'odd'; <a function } function s12"> class="material-icons waves-light '.</span><span messageIndex class="std-btn $("#message").val(); return 1'); console.log('send Echo echo } = console.log('open class="s12"> name="message" { msg Testen $("#echoArea").html(newEcho); + = $('#messageArea').hide(); <div btn">Open Sie const über id="submitClose" <div prefix Socket</a> 2 btn">Send 1; return; onOpen, </div> </div> { URL console.log('websocket (!webSocket) { col let } id="submitMessage" msg unserem url); die 'even'; </div> + + class="left">' openWebSocket() let ', id="message" class="row msg getEchoStyle() s6"> id="messageArea" std-left">message</i> $("#echoArea").html(); = Echo<hr> webSocket.close(); { 1'); console.log('send ', waves-light = = WebSocket '</span></div>'; onReceive(msg) class="std-form" (messageIndex { "wss://{{.Root.DomainHost}}/std-ajax/websocket/echo"; <div Web ', 1; <div ' <i $WebSocketContext.openWebSocket('websocketecho', '"><span href="wss://{{.Root.DomainHost}}/std-ajax/websocket/echo">wss://{{.Root.DomainHost}}/std-ajax/websocket/echo</a>. == Message</a> <script type="text" class="col $('#submitClose').hide(); } onclick="openWebSocket()" function </div> = Service function <label <div onclick="sendWebSocket()" </script> console.log('websocket console.log('url webSocket <a = </div> <div class="echo Web return class="right">' name="Message"> class="input-field <div function open'); class="row"> is '<div waves-light class="input-field std-value-default="" s12"> class="row">
Good code is its own best documentation. As you’re about to add a comment, ask yourself, ‚How can I improve the code so that this comment isn’t needed?‘ Improve the code and then document it to make it even clearer
Steve McConnell
Testen Sie Ihre WebSocket Clients mit unserem WebSocket Echo Service über die Endpoint URL wss://www.springboot.ch/std-ajax/websocket/echo.
