如何告诉java使用特定的传出ip接口来获取http请求? [英] How can I tell java to use a specific outgoing ip interface for a http request?

查看:966
本文介绍了如何告诉java使用特定的传出ip接口来获取http请求?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道在java中强制传出的http请求通过特定(逻辑)IP地址的快速方法吗?

Does anybody know a quick way to force an outgoing http request to go through a specific (logical) ip address, in java?

我正在考虑使用Apache HTTP客户端(http组件的一部分),肯定有足够的方法来实现它,但API看起来并不简单。有没有人用它做过类似的事情?

I'm thinking of using Apache HTTP client (part of http components), which surely enough has a way to do it, but the API looks not trivial. Has anybody already performed anything similar with it?

谢谢。

推荐答案

这有帮助吗?

如何使JVM默认使用给定的源IP?

这篇关于如何告诉java使用特定的传出ip接口来获取http请求?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆