mirror of
https://github.com/socketio/socket.io.git
synced 2026-04-30 03:00:39 -04:00
13 lines
201 B
JavaScript
13 lines
201 B
JavaScript
|
|
import io from 'socket.io-client';
|
|
|
|
const socket = io('http://localhost:3000');
|
|
|
|
console.log('init');
|
|
|
|
socket.on('connect', onConnect);
|
|
|
|
function onConnect(){
|
|
console.log('connect ' + socket.id);
|
|
}
|