Appcelerator How to use socket.io

node.js sockets socket.io appcelerator-alloy

286 просмотра

2 ответа

1 Репутация автора

I'm working on an app in Appcelerator, using alloy. I want to use socket.io in my application in order to receive live data from an API.

I've never used socket before. So, I just want to know how to include socket.io.

I've tried installing the socket.io through npm command. And also included a socket.io.js file.

But when I use var io = require('socket.io').listen(80); I'm unable to get the socket library.

Please help. Thanks.

Автор: Amaresh Beuria Источник Размещён: 19.07.2016 07:36

Ответы (2)


0 плюса

1 Репутация автора

OK! I did what I wanted using webView. Included the socket.io script and it worked like charm.

<script src="https://cdn.socket.io/socket.io-1.0.0.js"></script>

Автор: Amaresh Beuria Размещён: 19.07.2016 04:10

0 плюса

178 Репутация автора

You could also use tiws (iOS/Android) for creating native websockets, without WebViews.

Автор: Patrick De Marta Размещён: 14.08.2016 04:21
Вопросы из категории :
32x32