simple GPS server with node.js?


I have to create a simple service on linux VPS (IP: So whatever text/data will be sent to that linux server it will post that text/data to a website.

Some thing like

Server listening at port: 6345  
Received text: 'lng: 12.00, lat: 14.00, DeviceId: E8f4kakh'
/*I will convert text to proper query params*/
Post data to

I have no idea about linux programming. Can I do this using node.js? or any other simple language?

Problem courtesy of: coure2011


assuming you’re talking about a tcp server:

var http = require('http');
var net = require('net');
var mywebsite = http.createClient(80, '');

var server = net.createServer(function (socket) {
socket.write("GPS relay server\r\n");
socket.on("data", function (data) {
var request = google.request('POST', '/data',
{'host': ''});
request.on('response', function (response) {
socket.write('STATUS: ' + response.statusCode);


console.log('server listening on port 6345');

function convertTextToProperQueryParams(data) {
return ProperQueryParams;

Solution courtesy of: generalhenry

View additional discussion.