简体   繁体   English

如何通过Node.JS Server响应非标准(非HTTP)请求?

[英]How can I respond back to a non standard(non HTTP) request over Node.JS Server?

I am sending a non-standard request ie not HTTP request from my browser using my own developed Firefox Add-On. 我正在使用自己开发的Firefox插件从浏览器发送非标准请求,即不是HTTP请求。 I am able to receive the request on Node.JS server but I am not able to find a way to respond to the request with a static HTML page. 我可以在Node.JS服务器上接收请求,但无法找到一种使用静态HTML页面响应请求的方法。 I would like to emphasize that I not using HTTP server built over Node.JS. 我想强调一点,我没有使用通过Node.JS构建的HTTP服务器。 I just looking for a way to respond back to the client browser from which my own non-standard request was generated. 我只是在寻找一种方法来响应生成我自己的非标准请求的客户端浏览器。 I can't use http.createserver().listen(). 我不能使用http.createserver()。listen()。 I am using a function to fetch request generated by user. 我正在使用一个函数来提取用户生成的请求。 Thanks in advance. 提前致谢。

使用net.createServer而不是http.createServer。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何响应 Node.js 中的 post 请求? - How to respond to post request in Node.js? Node.js如何响应升级请求? - Node.js how to respond to an upgrade request? 如何响应 Node.JS 子进程中的提示 - How can I respond to a prompt in Node.JS child process 我如何使用 node.js http 开玩笑地模拟传入的 http 请求? - How I can mock an incomming http request in jest using node.js http? 如何构造/访问非node.js应用程序的react组件? - How can I structure/access the react components of my non node.js application? 如何将node.js回调定向到非匿名函数 - How can I direct node.js callback to a non-anonymous function 如何执行对由node.js服务器处理的http请求的查询字符串中的特定参数序列的检查? - How do I enforce a check for a particular sequence of parameters in the querystring of an http request handled by a node.js server? 如何将 Node.js http.IncomingMessage 转换为获取请求 object? - How can I turn a Node.js http.IncomingMessage into a Fetch Request object? 如何修复Node.js http发布请求或处理错误以更有效地进行调试? - How can I fix a Node.js http post request or handle errors to more efficiently debug? 如何向我的 Node.js HTTP 请求添加自定义值以供 Express 使用 - How can I add a custom value to my Node.js HTTP request for Express to consume
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM