|Portada|Blog|Space|
[Índice] > MidpSSH versión para ancel actualizado a la 1.7.0
El título lo dice todo, estoy acomodando el parche del MidpSSH para la versión
1.7.0 de forma tal que sea posible utilizarlo sin dramas desde la red de ancel.
Por suerte la nueva versión 1.7.0 es mucho más prolija y no hay que
hardcodear nada :)
El binario es este:
http://fideo.no-ip.info/midpssh-fcr.jar
Las modificaciones que hice son las siguientes:
En el paquete "gui.settings" en la clase SettingsForm:
...
cgHttpProxyMode.append("Persistent", null);
cgHttpProxyMode.append("Transient", null);
+ cgHttpProxyMode.append("HTTP Connect", null);
append(cgHttpProxyMode);
append( tfType );
...
En el paquete "app.session" en la clase Session, en el método connect:
...
String httpProxy = Settings.httpProxy;
if (httpProxy.length() == 0 || Settings.httpProxyMode == 0) {
conn = new StringBuffer("socket://").append(host);
//#ifdef blackberry
//# customiseConnectionString(conn);
//#endif
connection = (StreamConnection) Connector.open( conn.toString(), Connector.READ_WRITE, false );
in = connection.openDataInputStream();
out = connection.openDataOutputStream();
}
+ else if(Settings.httpProxyMode == 3) {
+ emulation.putString("\r\nUsing HTTP Connect Proxy...\r\n");
+ conn = new StringBuffer("socket://").append(httpProxy);
+ connection = (StreamConnection) Connector.open( conn.toString(), Connector.READ_WRITE, false );
+ in = connection.openDataInputStream();
+ out = connection.openDataOutputStream();
+
+ /* This is the code needed to connect to ancel's proxy
+ * it just uses the standard CONNECT method as if it were
+ * trying to make https connection. */
+ /* I let my ssh server listening in the port 443 and set
+ * the variable host (in the configuration) to something
+ * like "fideo.no-ip.info:443"... */
+ out.write(("CONNECT "+host+" HTTP/1.1\r\nHost: "+host+"\r\n\r\n").getBytes());
+ boolean emptyline=false, startline=true;
+ do{
+ int b = in.read();
+ emulation.putString(String.valueOf((char)b));
+ if(b == '\n'){
+ if(startline) emptyline=true;
+ startline=true;
+ }
+ if((b != '\r') && (b != '\n')) startline=false;
+ }while(!emptyline);
+
+ }
else {
/* Connect using HTTP proxy */
emulation.putString("\r\nUsing HTTP Proxy...");
int id = new Random().nextInt();
conn = new StringBuffer("http://").append(httpProxy).append('/').append(id).append('/').append(host);
...
---------
Los documentos en este sitio se encuentran licenciados bajo la GFDL.
Ver comentarios: [Hay i comentarios]
Para agregar un comentario: agregue a la URL: ?do=show_comment_form (explicación)