草庐IT

nodejs-websocket

全部标签

ruby - Faye WebSocket,关闭处理程序被触发后重新连接到套接字

我有一个super简单的脚本,它几乎包含了FayeWebSocketGitHub页面上用于处理关闭连接的内容:ws=Faye::WebSocket::Client.new(url,nil,:headers=>headers)ws.on:opendo|event|p[:open]#sendpingcommand#sendtestcommand#ws.send({command:'test'}.to_json)endws.on:messagedo|event|#hereistheentrypointfordatacomingfromtheserver.pJSON.parse(event.d

C/C++好用的websocket库

IntrductionLibwebsocketsisasimple-to-use,MIT-license,pureClibraryprovidingclientandserverforhttp/1,http/2,websockets,MQTTandotherprotocolsinasecurity-minded,lightweight,configurable,scalableandflexibleway.It’seasytobuildandcross-buildviacmakeandissuitablefortasksfromembeddedRTOSthroughmasscloudservi

ruby-on-rails - Websocket-rails 不适用于 Nginx 和 Unicorn 的生产环境

我有带有gemwebsocket-rails0.7的Rails3.2应用程序。在开发机上,一切正常在生产环境中,我使用Nginx/1.6作为代理服务器,Unicorn作为http服务器。Thin用于独立模式(在https://github.com/websocket-rails/websocket-rails/wiki/Standalone-Server-Mode之后)。nginx配置:location/websocket{proxy_passhttp://localhost:3001/websocket;proxy_http_version1.1;proxy_set_headerUp

WebSocket的那些事(1-概念篇)

目录一、什么是Websocket二、WebSocket部分header介绍三、HTTPVSWebSocket四、什么时候使用WebSockets五、关于SockJS和STOMP一、什么是Websocket根据RFC6455标准,Websocket协议提供了一种标准化的方式在客户端和服务端之间通过TCP连接建立全双工、双向通信渠道。它是一种不同于HTTP的TCP协议,但是被设计为在HTTP基础上运行。Websocket交互始于HTTP请求,该请求会通过HTTPUpgrade请求头去升级请求,进而切换到Websocket协议。请求报文如下:GET/spring-websocket-portfoli

ruby-on-rails - 如何使用 Rails/websocket-rails(独立)调试 'Invalid frame header' Websocket 问题

我开始使用websocket-rails,试图将旧的通知轮询系统(在Ruby2.1/Rails4.0上)转换为更现代的WS系统。我在独立模式下使用WebsocketRails,这是我的配置,基本上是默认配置:WebsocketRails.setupdo|config|config.standalone=trueend我还设置了一个在默认端口上运行的新Redis-这里似乎没有通信问题。在客户端,我添加了websocket-rails的JS,并在尝试打开连接和订阅channel时使用:@dispatcher=newWebSocketRails"localhost:3001/websocke

ruby-on-rails - 尽管安装了 therubyracer 和 nodejs,但找不到 JavaScript 运行时

我尝试在CentOS5上运行Rails应用程序并不断收到thiserror:CouldnotfindaJavaScriptruntime.Seehttps://github.com/sstephenson/execjsforalistofavailableruntimes.(ExecJS::RuntimeUnavailable)我同时安装了NodeJS(v0.8.15)和therubyracer(libv8)。这是我的gemlist:***LOCALGEMS***actionmailer(3.2.9,3.2.8)actionpack(3.2.9,3.2.8)activemodel(3.

ruby-on-rails - ActionCable - 无法在生产环境中升级到 WebSocket

ActionCable在生产中不起作用。在开发中运行良好,但在生产中运行不佳。在Ubuntu14.04上使用Puma运行Nginx。我已经检查过redis-server已启动并正在运行。Rails-v5.0.0.1production.log:INFO--:StartedGET"/cable/"[non-WebSocket]for178.213.184.193at2016-11-2514:55:39+0100ERROR--:FailedtoupgradetoWebSocket(REQUEST_METHOD:GET,HTTP_CONNECTION:close,HTTP_UPGRADE:)

ruby-on-rails - rails Assets 管道 "Cannot allocate memory - nodejs"

我们刚刚从Rails3.0.7升级到Rails3.2.5,并为暂存服务器即时使用Assets管道编译,但有时我们会遇到这个异常!Showing/var/rails/appname/app/views/common/_my_partial.html.hamlwhereline#raised:Cannotallocatememory-nodejs/tmp/execjs20120613-17090-thoc8f.js2>&1Extractedsource(aroundline#):Traceoftemplateinclusion:app/views/layouts/application.h

ruby - Sinatra 与 EventMachine WebSockets 一起使用是否成功?

我已经使用Sinatra一段时间了,我想通过websockets推送数据来为我的网络应用程序添加一些实时功能。我已经成功地单独使用了gem“em-websocket”,但无法编写一个具有sinatra网络服务器和网络套接字服务器的ruby​​文件。我试过旋转运行!或开始!方法在单独的线程中关闭但没有成功。有人用过这个吗?我想将它们放在同一个文件中,这样我就可以在两个服务器之间共享变量。 最佳答案 没试过,但应该不会太难:require'em-websocket'require'sinatra/base'require'thin'EM

nodejs

Nodejs介绍Nodejs是一个javascript运行环境(runTime)。它让javascript可以开发后端程序,它几乎能实现其他后端语言能实现的所有功能。nodejs是基于googleV8引擎,V8引擎是google发布的一款开源的javascript引擎,原来主要是用于Chrome浏览器的js解释部分,但是RyanDahl,鬼才般的把V8引擎搬到了服务器上,用于服务器的软件。为什么要使用NodejsNodejs有什么优点Nodejs语法完全是js语法,只要你懂js基础就可以学会Nodejs后端开发,Nodejs打破了过去JavaScript只能在浏览器中运行的局面。前后端编程环境