Node.js - forward all traffic from port A to port B

后端 未结 3 1433
小鲜肉
小鲜肉 2020-12-02 17:29

I\'m trying to forward all traffic from port 6999 to port 7000 (I know I could use iptables, but the idea is to use Node.js to do some packet inspection).

Here is th

3条回答
  •  [愿得一人]
    2020-12-02 18:18

    Have you looked at the Node.js module Hoxy?

    http://www.youtube.com/watch?v=2YLfBTrVgZU

    Quick description from the developer's README:

    Hoxy is a web-hacking proxy for node.js, intended for use by web developers. Using hoxy, you can act as a "man in the middle" and alter HTTP requests and responses as they flow through, based on a set of conditional rules. As a running process, hoxy otherwise behaves like a standalone proxy server. Hoxy was inspired as a way to complement debuggers like Firebug, which let you manipulate the client runtime but not the underlying HTTP conversation.

    This should work pretty well unless you're looking for a lower level, packet to packet inspection of the data.

提交回复
热议问题