简体   繁体   English

来自perl的websocket客户端

[英]websocket client from perl

I'm looking at building a monitor for our node.js server. 我正在为我们的node.js服务器构建监视器。 Was thinking of having a Perl client watching what comes out of the node.js pipeline and having that alert nagios if things aren't kosher. 正在考虑让Perl客户端监视来自node.js管道的内容,并在情况不佳时让nagios发出警报。

The node.js server responds fine to regular websocket connections from the browser, that part has been working for months, I'm just looking to add monitoring. node.js服务器对来自浏览器的常规websocket连接反应良好,该部分已经工作了几个月,我只是想添加监视功能。

Using the sample code in the Perl module AnyEvent::WebSocket::Client , the server logs this message and closes the connection 使用Perl模块AnyEvent :: WebSocket :: Client中示例代码 ,服务器记录此消息并关闭连接

   warn  - unknown transport: "undefined"

which is coming from node_modules/socket.io/lib/manager.js : 来自node_modules/socket.io/lib/manager.js

 if (!~this.get('transports').indexOf(data.transport)) {
    this.log.warn('unknown transport: "' + data.transport + '"');
    req.connection.end();
    return;
  }

I don't see any more documentation on setting "transport" in the Perl client, or on setting anything else for that matter. 我没有看到有关在Perl客户端中设置“运输”或与此相关的其他任何设置的文档。 It doesn't seem to be a query parameter in the url. 它似乎不是url中的查询参数。 Can anybody offer any suggestions or pointers as to what I might be missing? 有人可以就我可能缺少的内容提供任何建议或指示吗? Should that sample code work? 该示例代码应该工作吗?

你已经尝试过大树枝了吗

npm install nagios

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM