Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var net = require('net');
- var sqlclient = require('mysql').Client;
- var client = new sqlclient();
- client.user = '127.0.0.1'
- client.password = 'asdas123'
- client.connect(function(error, results) {
- if (error) {
- console.log('Connection Error: ' + error.message);
- return;
- }
- console.log('Connected to MySQL');
- startServer(client);
- }
- startServer = function(client)
- {
- var server = net.createServer(function(socket) {
- socket.on('data', function (data) {
- socket.write(data);
- var command = data.readUInt16LE(0);
- if (command == 0xA00) {
- }
- });
- });
- server.listen(8000);
- }
Add Comment
Please, Sign In to add comment