1.0.2 • Published 7 years ago

ibot-interface-socket.io v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
7 years ago

ibot-interface-socket.io

A socket interface for your bot (ibot)

Install

npm install --save ibot-interface-socket.io

Usage

// server.js

const iSocketIO = require('ibot-interface-socket.io')
const bot = require('./lib/your-ibot')

bot.configure({
    interface: iSocketIO
})

process.on('SIGINT', () => {
    bot.exit()
    process.exit()
});

bot.run()
// index.html

<script src="/socket.io/socket.io.js"></script>
<script>
  var socket = io('http://localhost:9911');
  socket.on('message', function (message) {
    console.log(data);
    socket.emit('data', 'hello');
  });
</script>

License

Under the MIT license. See LICENSE file for more details.

1.0.2

7 years ago