开发者

OSX - socket connect redirection

开发者 https://www.devze.com 2023-03-26 18:40 出处:网络
In my application, I want to redirect certain applications connections. In windows 7, you can modify the host and port used in a TCP/UDP connect call:

In my application, I want to redirect certain applications connections.

In windows 7, you can modify the host and port used in a TCP/UDP connect call: htt开发者_如何学JAVAp://msdn.microsoft.com/en-us/library/ff571005(v=vs.85).aspx

I was going to look at the tsocks source, however the author says it's not working with asynchronous sockets. It's a rather old project, and was wondering if there's any modern API.

Is there any reliable solution for doing this in OSX lion?

Thanks


Mac OS X, being a BSD-derived system, has ipfw, which is like Linux iptables. It lets you do this kind of thing at the OS level. The command-line tool is already installed on your mac (try man ipfw); Google will help you find graphical front ends for it.

0

精彩评论

暂无评论...
验证码 换一张
取 消