简体   繁体   English

我如何在我的 nginx 服务器上读取数据包,我正在发送数据包发送方

[英]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.

相关问题 当我在 nodeJS 中将代码作为 python shell 运行时,如何永久安装 python 包? - How can I install python packages permanently when I am running my code as a python shell in nodeJS? 如何使用 c header 文件在 Z28A3689BE95C88DD45E7A 中解析 UDP 数据包 - How can I parse a UDP packet using a c header file in node.js 使用Node.js数据包发送数据包 - Sending a packet with nodejs packets 如何将错误数据包发送到套接字io中的单个客户端? - How do I send an error packet to a single client in socket io? 如何从 Node.js 服务器(从端口 55000)向同一台计算机上运行的其他端口(可能是 8883)发送消息,例如“Hello I am Some Packet”? - How do I send a message e.g “Hello I am Some Packet” from Node.js Server(from port 55000) to other port(like maybe 8883) running on same computer? socket.io仅向发送方发送数据包 - socket.io send packet to sender only 你如何阻止客户端发送一个巨大的websocket数据包? - How do you prevent a client from sending a huge websocket packet? 为什么我的Ajax调用仅处理我发送到服务器的部分数据? - Why is my ajax call only handling part of the data i am sending to my server? TCP客户端/服务器数据包丢失 - TCP Client / Server packet loss nginx tcp SYN数据包未接收到ACK - nginx tcp SYN packet not receiving ACK
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM