1

First, sorry for my bad english.

I trying the last two days deepstream to run. The server startet but i can't connect from browser.

INFO | logger ready
INFO | deepstream version: 1.1.0
INFO | messageConnector ready
INFO | storage ready
INFO | cache ready
INFO | authenticationHandler ready: none
INFO | permissionHandler ready: none
INFO | Using uws websocket server
CLUSTER_JOIN | it9p2a8m-z77t85n9bk04
INFO | Listening for tcp connections on 127.0.0.1:6021
INFO | Listening for browser connections on 127.0.0.1:6020
INFO | Deepstream started

My index.html looks like this:

<!DOCTYPE html>
<html>
<head>
    <script src="https://cdn.rawgit.com/deepstreamIO/deepstream.io-client-js/master/dist/deepstream.min.js"></script>
</head>
<body>
<input type="text" />
<script type="text/javascript">
  var deepstream = require('deepstream.io-client-js');
  const client = deepstream('127.0.0.1:6020').login();
})
</script>
</body>
</html>

Can not connect with the browser to the server via 127.0.0.1:6021 . The browser only searching...

Is there a simple example? The only example on deepstream how I can run, is ds-demo-pong.

Thanks for your help and sorry for my bad english :-(

aynber
  • 22,380
  • 8
  • 50
  • 63
mekroth
  • 11
  • 1

1 Answers1

0

You can't use require within index.html directly.

Try:

<!DOCTYPE html>
<html>
<head>
    <script src="https://cdn.rawgit.com/deepstreamIO/deepstream.io-client-js/master/dist/deepstream.min.js"></script>
</head>
<body>
<input type="text" />
<script type="text/javascript">
  const client = deepstream('127.0.0.1:6020').login();
</script>
</body>
</html>

deepstream is exposed on the window if require isn't supported

yasserf
  • 391
  • 1
  • 7
  • First, thanks for the quick response. Have it changed, but now: `INCOMING_CONNECTION | from 127.0.0.1:32978 via tcp INCOMING_CONNECTION | from 127.0.0.1:32982 via tcp CLIENT_DISCONNECTED | null CLIENT_DISCONNECTED | null CONNECTION_AUTHENTICATION_TIMEOUT | connection has not authenticated successfully in the expected time` The same when remove "const client = deepstream('127.0.0.1:6020').login();" I get a crisis ;-) FeathersJS , Meteor , Angular everything I can test and run, but what interests me most is not going... – mekroth Sep 19 '16 at 08:52
  • Are you running it via 6021 or 6020? 6021 is pure TCP which isn't supported by browsers. – yasserf Sep 19 '16 at 13:04