Перенаправить / заблокировать исходящий HTTP-трафик для определенного URL на Mac

1323
guillaume

Я хочу знать, возможно ли перенаправить или заблокировать HTTP-трафик с помощью такой строки в Linux:

iptables -A OUTPUT -p tcp -m string --string "STRING" -j REJECT 
0

1 ответ на вопрос

1
MariusMatutiae

I am not sure I understand the question.

1) If the question is is there iptables in Mac?, the answer is yes, just use this link.

2) if the question is is this correct? then the answer is not completely: why would you want to use REJECT instead of DROP? According to the Man page for iptables,

REJECT

This is used to send back an error packet in response to the matched packet: otherwise it is equivalent to DROP so it is a terminating TARGET, ending rule traversal.

Do you really need the error packet?

3) The last point is: is iptables the correct instrument for Web filtering? Here the answer is most likely not. iptables is for firewalling udp/tcp traffic. If you want to do Web filtering, look at squid, privoxy,...

If however you prefer to do it this way, then the grammar of the command is well exemplified by a post on a sister site, here (see the second reply).

Вы уверены, что iptables можно установить с помощью macports? Потому что я не могу найти это. На самом деле мне нужна капля, а не отказ. Я смотрю Если я могу сделать то, что я хочу с privoxy, спасибо guillaume 10 лет назад 0
@ Guillaume Вы действительно правы, iptables нет в macports. Прошло так много времени с тех пор, как я его скачал, что забыл. Его можно найти здесь, http://en.softonic.com/s/iptables:mac/english-mac-x. Извиняюсь. MariusMatutiae 10 лет назад 0
О, спасибо, но Privoxy работают хорошо! И я думаю, что я создам крошечный прокси в C ++ или Java, чтобы делать только то, что я хочу guillaume 10 лет назад 0
@ Guillaume Рад слышать это. С новым годом. MariusMatutiae 10 лет назад 0

Похожие вопросы