Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/yuri2peter/socket-me

一个支持开放socketio客户端协议的服务端,很适合作为其他小的联机应用的公共服务器。
https://github.com/yuri2peter/socket-me

Last synced: about 2 months ago
JSON representation

一个支持开放socketio客户端协议的服务端,很适合作为其他小的联机应用的公共服务器。

Awesome Lists containing this project

README

        

# socket-me

一个支持开放 socketio 客户端协议的服务端,很适合作为其他小的联机应用的公共服务器。

## SocketIO Versions

- 服务端:4.5.1
- 客户端:4.5.0

对于客户端,推荐使用 CDN:

```html

```

## Quick Start

```html






socket-me





(() => {
// replace <server-host> with true hostname.
const socket = io('http://<server-host>');
socket.on('connect', () => {
console.log('socket connected.');
socket.emit('join', {
room: 'room-1',
name: 'yuri',
});
socket.emit('speak', {
to: { name: 'yuri' },
data: { msg: 'I am trying to speak to myself.' },
});
});
socket.on('speak', eventData => {
console.log(eventData);
});
socket.on('disconnect', () => {
console.log('socket disconnected.');
});
})();

```