Currently writing a synchronization mechanism over HTTP, I started to build my server on NodeJS, which looked like a good solution.
So Ok, I can get GET and HEAD methods working. But as soon as I try to use non standard methods, for example "SYNC". Here's the code:
var http = require("http");
var server = http.createServer(function (req, res) {
res.writeHead(200);
res.end(req.method);
});
server.listen(8080);
Looks alright... let's telnet this, issue a GET and then a SYNC request
mylaptop:~ aob$ telnet localhost 8080
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
GET / HTTP/1.1
HTTP/1.1 200 OK
Connection: keep-alive
Transfer-Encoding: chunked
3
GET
0
SYNC / HTTP/1.1
Connection closed by foreign host.
Any idea on how I can get SYNC to work ?