Deepstream无法正常工作

时间:2016-09-19 07:15:50

标签: javascript connect deepstream.io

首先,抱歉我的英语不好。

我尝试了最近两天的深度运行。服务器启动但我无法从浏览器连接。

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

我的index.html如下所示:

<!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>

无法通过127.0.0.1:6021与浏览器连接到服务器。浏览器只搜索...

有一个简单的例子吗? ds-demo-pong是dsstream-pong。

的唯一关于深度流动的例子

感谢您的帮助,抱歉我的英语不好: - (

1 个答案:

答案 0 :(得分:0)

您无法直接在require内使用index.html

尝试:

<!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>
如果不支持require

,则会在窗口中显示

deepstream