- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个在 Heroku 上运行的 Java 应用程序,需要访问 Salesforce,该应用程序仅允许从您列入白名单的 IP 进行 API 访问。 Proximo是一个 Heroku 插件,允许您通过具有静态 IP 的单个服务器代理您的应用程序发出的所有请求。不幸的是,执行此操作的标准方法 - running your app within Proximo's wrapper - 为我的应用程序的网络服务器创建监听套接字的过程变得困惑,as it seems to for a number of folks .
如何在我的 Java 应用程序中使用 Proximo 作为 SOCKS 代理?
最佳答案
我看了stacklet他们将其作为上述包装器进行分发,并发现它作为 SOCKS 代理连接到 Proximo 服务器。这在 Java 中很容易做到,所以我将其添加到我的应用程序的启动中(Groovy 语法):
URL proximo = new URL(System.getenv('PROXIMO_URL')
String userInfo = proximo.getUserInfo()
String user = userInfo.substring(0, userInfo.indexOf(':'))
String password = userInfo.substring(userInfo.indexOf(':') + 1)
System.setProperty('socksProxyHost', proximo.getHost())
System.setProperty('socksProxyPort', '1080')
Authenticator.setDefault(new ProxyAuth(user, password))
将 ProxyAuth 作为其他地方的内部类:
private class ProxyAuth extends Authenticator {
private PasswordAuthentication passwordAuthentication;
private ProxyAuth(String user, String password) {
passwordAuthentication = new PasswordAuthentication(user, password.toCharArray())
}
@Override
protected PasswordAuthentication getPasswordAuthentication() {
return passwordAuthentication;
}
}
关于java - 如何在 Java 中使用 Proximo 作为 SOCKS 代理?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21886916/
我刚刚为 python 应用程序安装了 Proximo heroku 附加组件。我加载了一个 shell 并踢了轮胎,点击 HTTP 地址有效,但 HTTPS 地址无效。 HTTP 地址显示在 Pro
我有一个在 Heroku 上运行的 Java 应用程序,需要访问 Salesforce,该应用程序仅允许从您列入白名单的 IP 进行 API 访问。 Proximo是一个 Heroku 插件,允许您通
我已经在 Heroku 上安装了 Proximo 附加组件,并且在将命令添加到现有命令之前时,我从 Java 得到了 BindException。这是我的前置命令的样子:web: bin/proxim
我是一名优秀的程序员,十分优秀!