Actualmente escribiendo un mecanismo de sincronización sobre HTTP, comencé a construir mi servidor en NodeJS, que parecía una buena solución.Método HTTP personalizado con el servidor HTTP de Nodejs
De acuerdo, puedo hacer funcionar los métodos GET y HEAD. Pero tan pronto como trato de usar métodos no estándar, por ejemplo "SYNC". Aquí está el código:
var http = require("http");
var server = http.createServer(function (req, res) {
res.writeHead(200);
res.end(req.method);
});
server.listen(8080);
ve bien ... vamos a telnet, emita un GET y luego una solicitud de sincronización
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.
alguna idea sobre cómo puedo conseguir SYNC para trabajar?
Bueno, eventualmente resolví esto agregando mi método HTTP a la fuente misma. Debe modificar http_parser.c y node_http_parser.c que puede encontrar en el paquete fuente. Luego recompila y diviértete. – aspyct
¡agradable! ¿Te importaría publicar tu solución? – mikermcneil
Hola :) Más de un año después, me temo que perdí ese código fuente. Pero fue bastante sencillo, por lo que probablemente pueda resolverlo siguiendo las instrucciones anteriores. – aspyct