Created
July 13, 2015 12:16
-
-
Save Waltari10/f360bde20da7563217f1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"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