我有两个 cordova 应用程序,需要通过套接字连接。是否可以仅通过 javascipt 执行此操作。
即;没有后端基础设施。点对点通信?
最佳答案
使用此插件在手机内部创建套接字服务器:
插件:https://github.com/becvert/cordova-plugin-websocket-server
插件:https://github.com/MobileChromeApps/cordova-plugin-chrome-apps-socket
文档:https://developer.chrome.com/apps/socket
对于客户端连接使用:
插件:https://github.com/MobileChromeApps/cordova-plugin-chrome-apps-sockets-udp
文档:https://developer.chrome.com/apps/sockets_udp
插件:https://github.com/MobileChromeApps/cordova-plugin-chrome-apps-sockets-tcp
文档:https://developer.chrome.com/apps/sockets_tcp
使用所需的插件。
谢谢。
关于javascript - Cordova 套接字编程,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39525618/