简体   繁体   English

如何在Windows上使用Lua Web套接字?

[英]How to use lua web sockets on windows?

This answer suggests this library to use web sockets for lua. 答案表明库使用Web套接字进行lua。

The installation guide of the library contains three strings: 该库的安装指南包含三个字符串:

$ git clone git://github.com/lipp/lua-websockets.git $ git clone git://github.com/lipp/lua-websockets.git

$ cd lua-websockets $ cd lua-websockets

$ luarocks make rockspecs/lua-websockets-scm-1.rockspec $ luarocks制作rockspecs / lua-websockets-scm-1.rockspec

I don't know what results of the last command should be and how to proceed from executing it to compiling examples. 我不知道最后一条命令的结果应该是什么,以及如何从执行它到编译示例如何进行。 But on my PC it only produces error message 但是在我的电脑上,它只会产生错误消息

'"C:\\Program Files (x86)\\LuaRocks\\\\lua5.1.exe"' is not recognized as internal or external command, operable program or batch file 无法将““ C:\\ Program Files(x86)\\ LuaRocks \\\\ lua5.1.exe”识别为内部或外部命令,可运行程序或批处理文件

in visual studio 2015 developer console. 在Visual Studio 2015开发人员控制台中。

In regular console it just complains that cl is not recognized 在常规控制台中,它只是抱怨无法识别cl

I want to know not only ways of fixing the error, but all actions needed to start communicating with websockets from a lua script on windows with this library or another one. 我不仅想知道纠正错误的方法,而且想知道从该库或其他库的Windows上的lua脚本开始与websocket通信的所有操作。

The script will be run in vm provided by a third party app. 该脚本将在第三方应用程序提供的vm中运行。 I can require external modules from it. 我可以从中require外部模块。 I installed luarocks from developer console. 我从开发人员控制台安装了羽绒被。 There are no other installed lua frameworks/compilers. 没有其他已安装的lua框架/编译器。 The system is windows 8. 系统是Windows 8。

If you need to run this as the client, then you only need three pieces: lua interpreter, luasocket library, and the lua-websockets module you referenced. 如果您需要以客户端身份运行它,则只需三部分:lua解释器,luasocket库和您引用的lua-websockets模块。 The module has other dependencies (luabitop and copas), but those are optional if you just want to try simple sync calls using luasocket. 该模块还有其他依赖项(luabitop和copas),但是如果您只想使用luasocket尝试简单的同步调用,则这些依赖项是可选的。 You can compile luasocket libraries yourself (that's what luarocks probably attempted for you to do, but you can also do it from the command line) or find already compiled libraries; 您可以自己编译luasocket库(这可能是luarocks试图尝试的,但是您也可以从命令行执行)或找到已经编译的库。 for example, see this discussion for details. 例如,有关详细信息,请参见此讨论

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

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