目的是在卫星服务器和集中式注册数据库之间建立n个ssh隧道.我已经在我的服务器之间设置了公钥认证,因此他们只需在没有密码提示的情况下直接登录.怎么办 ?我试过帕拉米科.虽然代码exmplaes会受到重视,但它似乎还算不错,但只是设置了一个基本的隧道.我已经尝试过Autossh,它在设置工作隧道后2分钟就死了,很奇怪!希望有人可以帮助我使用一个简单的代码片段,我可以使用supervisord或monit进行守护和监视.
我有一个Ubuntu服务器example.com,我已经ssh'ed它.但只有在我进入它之后,才能意识到我的意思ssh -L 8000:localhost:9000 example.com.有没有办法在已建立并运行的ssh连接中创建该隧道?
只需将其保留在此处,这样就不会丢失解决方案的链接。
我有一个4096字节的RSA私有密钥(可能是使用本指南https://help.github.com/en/articles/generating-a-new-ssh-key-and-adding-it-to-the -ssh-agent)。
尝试使用DBeaver(6.1.2)通过ssh隧道建立新连接时出现错误。
invalid privatekey: [B@540.....
Run Code Online (Sandbox Code Playgroud) 手机型号:bb曲线8520
电话版本:4.6.1.314
承运人:印度的airtel
APN:airtelgprs.com
没有用户名和密码
我使用以下代码:
String url="http://<address>:<port>/path;deviceside=true";
HttpConnection conn =(HttpConnection)Connector.open(url,Connector.READ_WRITE,true);
int response=conn.getResponseode();
if(responsecode==HttpConnection.HTTP_OK)
{
//...code for handling the response...
}
Run Code Online (Sandbox Code Playgroud)
此代码抛出"隧道失败"异常.我无法理解它背后的原因.根据网络运营商,在电话中正确定义了APN.我也可以通过浏览器访问互联网.
如果您知道隧道故障或严重隧道故障的原因,请回复我.
还有一件事,代码在我附加interface=wifi到位时工作正常deviceside=true(这需要打开并连接WIFI).
[编辑]
我检查了BlackBerry Curve 8520 mobile中的日志,它看起来像这样:
E net.rim.tcp-TNLf 0
a net.rim.tunnel-pdp2 1
a net.rim.hrtRT-EPRj 0x2100000001
a net.rim.tunnel - STnc-00000000
a net.rim.tunnel- Open - airtelgprs.com
a net.rim.tcp-open
Run Code Online (Sandbox Code Playgroud)
看到日志后有人猜错了吗?
我使用Java套接字创建了一个代理服务器(Fwd和Reverse).
这将听取在浏览器中配置的8080上的传入请求并将它们转发到另一个Proxy Server2.
并读取server2发送的响应并将其写入浏览器.
同时代码将记录请求和响应,并阻止某些预定义的请求类型来自浏览器.
现在我想使用Jetty执行此操作,并且还支持HTTPS请求.
我搜索了一些例子,但没有找到.
这启动服务器在8080,我已在浏览器的代理设置中配置为代理端口.
import org.eclipse.jetty.server.Server;
import Handler.HelloHandler;
public class StartJetty
{
public static void main(String[] args) throws Exception
{
Server server = new Server(8080);
server.setHandler(new HelloHandler());
server.start();
server.join();
}
}
Run Code Online (Sandbox Code Playgroud)
这是我用来监听请求并将响应写回浏览器的处理程序.
package Handler;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.eclipse.jetty.server.Request;
import org.eclipse.jetty.server.handler.AbstractHandler;
public class HelloHandler extends AbstractHandler
{
final String _greeting;
final String _body;
public HelloHandler()
{
_greeting="Hello World";
_body=null;
}
public HelloHandler(String greeting)
{
_greeting=greeting;
_body=null;
}
public HelloHandler(String greeting,String body) …Run Code Online (Sandbox Code Playgroud) 我想使用file_get_contents(URL)向网站发送获取请求。但是问题是URL仅接受来自某些IP地址的请求。我想知道是否可以从Web服务器发送相同的请求,以便该请求在该服务器上看起来就像该请求来自允许的IP