客户端连接时出现socket.io错误(socket.io errors when client connects)
我在我的node.js安装上成功运行了socket.io。
info - socket.io started
控制台显示它运行正常,但是一旦客户端(浏览器)连接:
socket = io.connect('<my host>:8000');
控制台正在发出错误:
crypto.js:123 return new Hash(hash); ^ TypeError: undefined is not a function at Object.createHash (crypto.js:123:10) at WebSocket.onSocketConnect (/node_modules/socket.io/lib/transports/websocket/hybi-16.js:120:23) at WebSocket.handleRequest (/node_modules/socket.io/lib/transport.js:71:10) at WebSocket.Transport (/node_modules/socket.io/lib/transport.js:31:8) at new WebSocket (/node_modules/socket.io/lib/transports/websocket/hybi-16.js:59:13) at new WebSocket (/node_modules/socket.io/lib/transports/websocket.js:31:17) at Manager.handleClient (/node_modules/socket.io/lib/manager.js:661:19) at Manager.handleUpgrade (/node_modules/socket.io/lib/manager.js:618:8) at Server.<anonymous> (/node_modules/socket.io/lib/manager.js:123:10) at Server.emit (events.js:88:20)
谁能理解这可能意味着什么?
我的代码在我的本地机器上工作正常,只有在将它移动到生产服务器时才会发生此错误。
I have socket.io running successfully on my node.js installation.
info - socket.io started
The console shows it running ok, but as soon as the client (browser) connects:
socket = io.connect('<my host>:8000');
The console is kicking out an error:
crypto.js:123 return new Hash(hash); ^ TypeError: undefined is not a function at Object.createHash (crypto.js:123:10) at WebSocket.onSocketConnect (/node_modules/socket.io/lib/transports/websocket/hybi-16.js:120:23) at WebSocket.handleRequest (/node_modules/socket.io/lib/transport.js:71:10) at WebSocket.Transport (/node_modules/socket.io/lib/transport.js:31:8) at new WebSocket (/node_modules/socket.io/lib/transports/websocket/hybi-16.js:59:13) at new WebSocket (/node_modules/socket.io/lib/transports/websocket.js:31:17) at Manager.handleClient (/node_modules/socket.io/lib/manager.js:661:19) at Manager.handleUpgrade (/node_modules/socket.io/lib/manager.js:618:8) at Server.<anonymous> (/node_modules/socket.io/lib/manager.js:123:10) at Server.emit (events.js:88:20)
can anyone understand what this might mean?
My code has been working fine on my local machine, its only when moving it to my production server does this error happen.
原文:https://stackoverflow.com/questions/15176025
更新时间:2023-09-02 19:09
最满意答案
function thisIsMyFunction(count, string) { var intArray = []; for (var i = 0; i < count; i++) { intArray.push(i); } return intArray; }
function thisIsMyFunction(count, string) { var intArray = []; for (var i = 0; i < count; i++) { intArray.push(i); } return intArray; }
相关问答
更多-
你可以使用$.parseJSON 。 例如: http : //jsfiddle.net/ULkXy/ var columns = $('#dynamicTable').attr('columns'); var attributeIds = $.parseJSON( '[' + columns + ']' ); 下面是使用一元+运算符使用while循环的另一种方法: 例如: http : //jsfiddle.net/ULkXy/1/ var columns = $('#dynamicTable').at ...
-
如何将在TextBox控件中输入的long拆分为int数组(How to split a long entered in TextBox control into int array)[2021-11-26]
第二个片段几乎就在那里(假设您需要一个数字数组,并且Text属性中只包含数字)。 删除对Split()的调用, Select()部分将遍历字符串中的每个字符。 var array = inputWindow.Text.Select(i => Convert.ToInt32(i-48)).ToArray(); That second snippet is almost there (assuming you want an array of numbers, and that the Text proper ... -
我想你需要知道的是strtol() 。 在这里阅读细节。 只是引用必要的部分 long int strtol(const char *nptr, char **endptr, int base); strtol()函数根据给定的base将nptr字符串的初始部分转换为long int eger值,该值必须介于2和36之间,或者是特殊值0 。 I think what you need to know is strtol(). Read details here. Just to quote the esse ...
-
function thisIsMyFunction(count, string) { var intArray = []; for (var i = 0; i < count; i++) { intArray.push(i); } return intArray; } function thisIsMyFunction(count, string) { var intArray = []; for (var i = 0; i < count; ...
-
生成的数组是一个二维数组,Java中允许使用以下内容。 int[][] split = new int[4][]; split[0] = new int[3]; split[1] = new int[1]; split[1] = new int[3]; split[1] = new int[2]; //note: you can use variables instead integer values (like 4, 3, 2, ...) here 您可以利用该信息来形成新阵列。 更新 List
将数组拆分为数组数组(Split array into array of arrays)[2024-02-27]
我会写一个扩展方法: public static class SOExtensions { public static IEnumerable> GroupSequenceWhile (this IEnumerable seq, Func condition) { List list = new List (); using (var en = seq.GetEnumerator()) ... 这有点棘手,但我希望这就是你所追求的。 希望代码中的注释足够描述,如果没有,我想发表评论。JTextField到int []数组?(JTextField to int[] array?)[2021-09-14]
private JTextField txtValues = new JTextField("25, 50, 80, 90"); // Strip the whitespaces using a regex since they will throw errors // when converting to integers String values = txtValues.getText().replaceAll("\\s",""); // Get the inserted values of t ...将jQuery集合拆分为单个jQuery对象的数组(Split jQuery collection into an array of individual jQuery objects)[2023-06-17]
你可以这样做: var $input = $("input"); var $$input = $input.map(function() { return $(this); }).get(); console.log($input instanceof Object); // true console.log($input instanceof jQuery); // true console.log($$input instanceof Array); // true $input.eq(3) ...将数组拆分为多个数组(Split a array into multiple array)[2024-02-22]
public static IEnumerable- > SplitArray
(T[] arr, int splitsNumber) { var list = arr.ToList(); int size = list.Count / splitsNumber; int pos = 0; for (int i = 0; i + 1 < splitsNumber; ++i, pos += size) { yield return lis ... 相关文章
更多- HDFS Client如何从Datanode读取block
- HDFS源码分析——RPC Client实现
- HDFS Datanode与Client之间的数据传输
- java server怎样和c++ client实现SSL通信??
- solr实例代码 import org.apache.solr.client.solrj.SolrServer
- Redis 客户端连接、密码验证、连接数设置
- HDFS1.0源代码解析—Hadoop的RPC机制之Client解析
- solr python client
- storm client command
- java socket server
最新问答
更多- 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
- 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
- OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
- 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
- codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
- 在计算机拍照在哪里进入
- 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
- No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
- 单页应用程序:页面重新加载(Single Page Application: page reload)
- 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
- System.StackOverflow错误(System.StackOverflow error)
- KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
- 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
- android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
- TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
- 企业安全培训的各项内容
- 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
- C#类名中允许哪些字符?(What characters are allowed in C# class name?)
- NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
- 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
- 将多个行和可变行移动到列(moving multiple and variable rows to columns)
- 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
- 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
- Angular $资源不会改变方法(Angular $resource doesn't change method)
- 在Angular 5中不是一个函数(is not a function in Angular 5)
- 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
- 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
- 常见的python rpc和cli接口(Common python rpc and cli interface)
- Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
- 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)