在没有 node.js 的情况下使用 socket.io 独立 [英] Using socket.io standalone without node.js

查看:32
本文介绍了在没有 node.js 的情况下使用 socket.io 独立的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

(JavaScript 新手)

(JavaScript newbie)

我正在尝试构建一个基于 JavaScript 的客户端应用程序,该应用程序通过套接字与服务器应用程序进行通信.我遇到了 socket.io.是否可以在没有任何 node.js 依赖项的情况下使用 socket.io?

I am trying to build a JavaScript based client app that communicates with a server app over socket. I came across socket.io. Is it possible to use socket.io without any node.js dependencies?

我已经克隆了 socket.io github 并编写了一个简单的客户端 html 来连接到服务器(如果需要,可以发布代码).但是它没有连接到服务器.

I have cloned socket.io github and wrote a simple client html to connect to the server (Can post the code if required). But it does not connect to the server.

(背景信息:我们需要一个在 Win32 上运行的简单配置客户端实用程序,该实用程序与支持使用自定义数据包格式协议的套接字通信的自定义服务器进行通信.我们认为 HTML 不是通过通常的 MFC/.NET/JS/CSS 提供了更好的解决方案.为此,我考虑了以下选项:

(Background info: We need a simple config client utility that runs on Win32 that communicates with a custom server that supports socket communication with a custom packet-format protocol. Instead of going through the usual MFC/.NET, we think HTML/JS/CSS makes a better solution. For this purpose, I have considered the following options:

  1. Titanium:可以使用,但需要安装运行时
  2. HTML5 WebSocket:不受广泛支持 - 适用于 Chrome,但需要 IE10
  3. socket.io:尝试让它工作
  4. 还有别的吗?(如有必要,可以将此问题作为单独的线程发布))

推荐答案

建立一个成功的 Socket.IO,你的自定义服务器必须遵循 规范,或使用socket.io的其他服务器实现
https://github.com/learnboost/socket.io/wiki 在其他语言中部分包括socket.io的一些服务器实现

Establish a successful Socket.IO, your custom server must follow the spec, or use other server implementation of socket.io
https://github.com/learnboost/socket.io/wiki the In other languages part include some servers implementation of socket.io

这篇关于在没有 node.js 的情况下使用 socket.io 独立的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆