Skip to content

Lotency/mysocket

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mysocket

关于socket.io的学习和测试


  1. 先安装依赖
npm i -s socket.io
  1. 启动服务
node server.js
  1. 浏览器打开index.html

模块化开发的时候

2018.10.16

  1. 安装依赖
npm i -s socket.io-client
  1. 在模块中使用
import io from 'socket.io-client'

let socket = io('ws://localhost:3000');

socket.emit('login', {});

学习参考:Socket.IO英文文档

About

关于socket.io的学习和测试

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published