Skip to content

Instantly share code, notes, and snippets.

@Waltari10 Waltari10/javaaa
Created Jul 13, 2015

Embed
What would you like to do?
"use strict";
var WebSocketServer = require('ws').Server
, wss = new WebSocketServer({ port: 8080 });
var mysql = require('mysql');
var connection = mysql.createConnection({
host : 'localhost',
user : 'root',
password : 'password',
database : 'test',
debug : true
});
console.log(connection.query);
wss.on('connection', function connection(ws) {
ws.on('message', function incoming(textChunk) {
console.log(connection);
console.log(connection.query);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.