State of affairs
I’ve a server pay attention on port 3000 on localhost. I would like incoming site visitors to localhost:8080 to be forwarded to that server.
My arrange:
- Server listens on port 3000; nothing listens on port 8080
- pfctl:
rdr move go online lo0 proto tcp from any to any port 8080 -> 127.0.0.1 port 3000
- watch all incoming connections to port 8080 on lo0 interface:
sudo tcpdump -nn -i lo0 dst port 8080 -v
Take a look at
curl localhost:8080
Anticipate
- server on port 3000 will get request from curl
- tcpdump returns sth like: 127.0.0.1.57330 > 127.0.0.1.3000 < more-info >
Actuality
- curl will get
curl: (7) Failed to hook up with localhost
port 8080: Connection refuse - tcpdump returns 127.0.0.1.57330 > 127.0.0.1.8080 < more-info >
=> tcpdump output signifies that the rule was not utilized for the reason that vacation spot port continues to be 8080 and never 3000.
Query
The place did my configuration went fallacious and the right way to make it proper?