[英]How can I read a packet with on my nginx server, I am sending the packages with packet sender
I am sending TCP packets with packet sender.我正在向数据包发送者发送 TCP 个数据包。 I need to process those packets on my Nginx web server.
我需要在我的 Nginx web 服务器上处理这些数据包。
I am going to store the data on my database and present it on the front-end later on with MeteorJS.我打算将数据存储在我的数据库中,稍后使用 MeteorJS 将其呈现在前端。 Can I do the packet receiving with node.js and how?
我可以用 node.js 接收数据包吗?怎么做?
I'll be appreciated if you can help me, thanks.如果你能帮助我,我将不胜感激,谢谢。
I have handled this situation with node.js using createServer from .net", here is my server main.js我已经使用 .net 中的 createServer 处理了 node.js 的这种情况”,这是我的服务器 main.js
import { Meteor } from 'meteor/meteor';
import { createServer } from "net";
Meteor.startup(() => {
const server = createServer(socket => {
socket.write("RECEIVED!")
socket.on("data", data => {
const text = data.toString();
console.log(text);
})
})
server.listen(8080)
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.