📄 webforward.java
字号:
/*
* SSL-Explorer
*
* Copyright (C) 2003-2006 3SP LTD. All Rights Reserved
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
package com.sslexplorer.webforwards;
import com.sslexplorer.policyframework.Resource;
import com.sslexplorer.replacementproxy.Replacement;
/**
* <p>
* Interface that encapsulates a single web destination that may be accessed
* using SSL-Explorers <strong>Web Forwarding </strong> feature.
*
* <p>
* Currently, 3 different types of web forward are supported.
* {@link #TYPE_TUNNELED_SITE},{@link #TYPE_REPLACEMENT_PROXY}and
* {@link #TYPE_REVERSE_PROXY}.
*
* <p>
* Instances are provided by the {@link com.sslexplorer.security.SystemDatabase}
* implementation in use.
*
* @author Brett Smith
* @version $Revision$
*/
public interface WebForward extends Resource {
/**
* <p>
* A <i>Tunneled site </i> web forward requires the VPN Client to be running
* and works by configuring a temporary tunnel connected to the provided
* destination that the client browser will be pointed to.
*
* <p>
* This will generally only work when used with a simple static site that
* contains only relative links.
*
* <p>
* Because the VPN client will not necessarily know if the browser using the
* temporary tunnel has been closed, such tunnels are subject to a time out
* as configured in the users profile.
*
*/
public final static int TYPE_TUNNELED_SITE = 0;
/**
* <p>
* The <i>Replacement Proxy </i> web forward works by loading the required
* content through the Replacement proxy engine which is launched via the
* {@link com.sslexplorer.replacementproxy.actions.GetURLAction}
* Struts action, with the actual require path encoded in the request as a
* parameter.
*
* <p>
* This engine then examines all of the HTTP headers and returned content
* (HTML, CSS, JavaScript etc) and replaces all links that it can find with
* a special URL always pointing to the SSL-Explorer server.
* </p>
*
* <p>
* For example, say a web forward is configured for the destination of <a
* href="http://www.google.com">http://www.google.com </a>. The link
* generated to launch the web forward would read <a
* href="https://localhost/getURL.do?sslex_url=http://www.google.com">
* https://localhost/getURL.do?sslex_url=http://www.google.com </a> and
* subsequent links generated by the engine would read
* <a
* href="https://localhost/replacementProxyEngine?sslex_ticket=SPT12345&sslex_url=http://www.google.com">
* https://localhost/replacementProxyEngine?sslex_ticket=SPT12345&sslex_url=http://www.google.com </a> where
* sslex_ticket is a unique id that represents the current Replacement proxy session and sslex_url
* tells the engine which page to get from the remote server.
*
* <p>
* The replacements to perform are determined by the {@link Replacement}
* object that are returned by the
* {@link com.sslexplorer.security.SystemDatabase#getReplacementsForContent(String, int, String, String)}.
* method. The contain the regular expressions that should be used to parse
* the content.
*
* <p>Unfortunately, some sites that contain lots of JavaScript or other
* advanced techniques are beyond this method - although the user may
* define their own replacements.
*
*
*/
public final static int TYPE_REPLACEMENT_PROXY = 1;
/**
* <p>Reverse proxy works by simply redirecting all HTTP requests received
* by SSL-Explorer that are for paths at or below the specified destination
* path to the destination hosts.
*
* <p>This will only work if the target hosts content is not a the root
* of the web provided by that server. I.e a destination path of
* http://mail.someco.com/exchange would work, but a path of http://exchange.someco.com/
* would not.</p>
*
* <p>With this method there is also a danger of conflicting paths.
*
*/
public final static int TYPE_REVERSE_PROXY = 2;
/**
* Tunneled Site String.
*/
public final static String ATTR_TUNNELED_SITE = "Tunneled Site";
/**
* Relpacement Proxy String.
*/
public final static String ATTR_REPLACEMENT_PROXY = "Replacement Proxy";
/**
* Rreverse Proxy String.
*/
public final static String ATTR_REVERSE_PROXY = "Reverse Proxy";
/**
* The type of the web forward. Can be one of {@link #TYPE_TUNNELED_SITE},
* {@link #TYPE_REPLACEMENT_PROXY}or {@link #TYPE_REVERSE_PROXY}.
*
* @return type
*/
public int getType();
/**
* Get address to which this forward should direct itself
*
* @return name
*/
public String getDestinationURL();
/**
* Get the category for this web forward.
*
* @return default value
*/
public String getCategory();
/**
* Set the category for this web forward.
*
* @param category category
*/
public void setCategory(String category);
/**
* Set the destination URL for this web forward
*
* @param destinationURL destination url
*/
public void setDestinationURL(String destinationURL);
/**
* Set the type for this webforward. Can be one of {@link #TYPE_TUNNELED_SITE},
* {@link #TYPE_REPLACEMENT_PROXY}or {@link #TYPE_REVERSE_PROXY}.
*
* @param type type
*/
public void setType(int type);
/**
* Set the resource Id
*
* @param id
*/
public void setResourceId(int id);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -