Paste number 145683: testing websockets

Paste number 145683: testing websockets
Pasted by: phasefx
When:6 years, 11 months ago
Share:Tweet this! | http://paste.lisp.org/+34ER
Channel:None
Paste contents:
Raw Source | XML | Display As
<html>
  <head>
    <script src='src/JSON_v1.js'></script>
    <script src='src/opensrf.js'></script>
    <script src='src/opensrf_ws.js'></script>
    <script>
      OpenSRF.Session.transport = OSRF_TRANSPORT_TYPE_WS_SHARED;
        var ses = new OpenSRF.ClientSession('opensrf.math'); // Evergreen
        var req = ses.request({
          method : 'opensrf.system.echo',
          params : ['hello', 'websockets'],
          onresponse : function(r) {
            alert('onresponse() => "' + r.recv().content() + '"');
          },
          oncomplete : function() {
            alert('oncomplete()');
          }
      });
      req.send();
      req.session.send_ws();
    </script>
  </head>
  <body><h1>If you get alerts, you win!</h1></body>
</html>

This paste has no annotations.

Colorize as:
Show Line Numbers

Lisppaste pastes can be made by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively.