cordis/archive/server-test/client.ts

16 lines
376 B
TypeScript
Raw Normal View History

import * as fs from 'fs';
import * as path from 'path';
import * as socketio from 'socket.io-client';
const socket = socketio.connect('https://localhost:4040', {
ca: fs.readFileSync(path.join(__dirname, '../../server-test/ssl/cert.pem')).toString(),
});
socket.on('connect', () => {
socket.emit('hello');
});
socket.on('exde', () => {
console.log('got an exde :V');
});