Very happy, now have time to write their own blog, now roughly write about the proxy mode it ...The same, as in previous sources, are learned from Marco Video.The so-called agent is one person or one body acting on behalf of another person or another body. In some cases, a client does not want or cannot refer directly to an object, whereas a proxy object can act as an intermediary before the client and the
regular proxy server to tell others, because the use of more people will naturally slow. But there are many Web sites and BBS to provide free proxy server address, you can use your own search engine (such as Sohu, Sina) Check proxy or free agent, you can find a lot of similar sites.
When it comes to search agent software, the Agent Hunter, the wizard-style onlin
, InvocationHandler h: the second input parameter is the list of interfaces implemented by the proxy example. The performance of the proxy object created by CGLIB is higher than that created by JDK, but it takes a relatively long time. Besides, CGLIB uses dynamic subclass creation to generate the proxy object, therefore, Methods Modified by final cannot be
Static proxy
Package com.iter.devbox.staticProxy;
Public interface Star {public
void Sing ();
}
Package com.iter.devbox.staticProxy;
public class Realstar implements Star {
@Override public
void Sing () {
System.out.println this.getclass ( ). GetName () + ". Sing ()");
}
Package com.iter.devbox.staticProxy;
Public class Starhandler implements star {
private star Realstar;
Public Starhandler (Star Realstar) {
supe
the agent. ==================================================== above is the forward proxy/below is the reverse proxy =========================================== = = Reverse Proxyconcept of (reverse proxy)Reverse Proxy common software:Fikker, Nginx, SquidContinue Example: Example user access
worry about yourself!
The above is the main function of the software, and many other functions we can practice in the practical.
Four, browser settings:For stand-alone use, access the Internet via port 8088 through local localhost or 127.0.0.1. If used in the LAN, it needs to be set to install the actual IP of the multiproxy computer.Take IE5.5 as an example to illustrate the settings.1, the choice of tools in IE | Internet Options ... | Connect, select a dial-up connection, select "Use Agent
1. What is proxy?
;
In computer terms, proxy is called proxy server. Its function is to obtain network information by proxy network users.
It is a transfer station for network information. In general, when we use a web browser to directly connect to other Internet sites to obtain network information, we must send a req
Document directory
Proxy in Design Mode)
Proxy in Design Mode)
Transferred from:
Http://www.blogjava.net/lusm/archive/2007/08/08/135355.html
Http://www.blogjava.net/lusm/archive/2007/08/09/135433.html
Definition in Design Pattern: Fronting for another object (provides a proxy
#定义代理缓存路径, cache file save path cache initial size and maximum cache time
Proxy_cache_path d:\code\cache levels=1:2 keys_z max_size=20m inactive=1m;
Location/{
#配置上面定义的keys_zone的值Proxy_cache cache1;
#配置url中包括哪个参数的时候不去缓存中查询Proxy_cache_bypass $arg _name;
#定义缓存的keyProxy_cache_key $host $uri$is_args$args;
#缓存时间, if there is cache-control in the header information in response, the cache time in the header will prevail.Proxy_cache_valid 2m;
#当缓存失效后回源出错的时候可以使用缓存中旧数据, the old is better than wron
The way to implement the proxy is to install the proxy Server software on the server, so that it becomes a proxy server, open source software is more popular is squid and nginx.First, the forward agentA forward proxy is a server between client A and the original Server B, in order to get content from the server, the us
: obtains the subclass instance of the InvocationHandler interface.
See the author's analysis of the above source code in the following article.
[Original] JDK dynamic proxy, which will never be forgotten after this time. Http://www.cnblogs.com/dreamroute/p/5273888.html
A thorough understanding of JAVA Dynamic proxy http
need to set up, the proxy server will establish a transparent channel, so that users directly communicate with the outside world, which greatly facilitates the user's use. When using a proxy server generally, each user needs to indicate in the client program that they want to use the proxy, setting proxy parameters (s
Proxy-target-class= "true"/>
Note: The Proxy-target-class property value determines whether an interface based or a class-based proxy is created. If the value of the Proxy-target-class property is set to True, the class based proxy will work (this requires a cglib library).
Transferred from: http://blog.csdn.NET/shixing_11/article/details/7106241has been on the reverse of reflection agent do not know how to understand, after Baidu know, combined with the following this picture, finally make clear a little. Simply say from a LAN to the server to the positive, from the client to enter a LAN for the reverseConcept :The reverse proxy method refers to a
server that accepts connection requests on the Internet, then forwards the request to a server on the internal network and returns the results from the server to the client requesting the connection on the Internet, Reverse. At this point the proxy server is represented as a server externally.Overview:The usual proxy server, which is used only to proxy connectio
class invocation. At the moment, base is not a pure target class, but an enhanced target class
base = (base) enhancer.create ();
return base;
}
4. Test class
Package cglibproxy;
/**
* @author Typ * * * * *
/Public
class Test {public
static void Main (string[] args) {
Cglibproxy proxy = new Cglibproxy ();
Base base
= Factory.getinstance (proxy) for the generated enhanced target class;
Bas
setBlock, All"Via:"The first line will be deleted. There will be no new"Via:"Header.
1
The proxy can be used on the local machine.
1.2 browser settings (taking Firefox as an example)
1.3 access results
Visit www.sina.com and observe the HTTP request response:
We can see that via: www.test.com, the forward proxy is successful.
2. Reverse
: This article mainly introduces the differences between nginx Reverse proxy and forward proxy. For more information about PHP tutorials, see. I have always had no idea how to understand the reverse direction of the reflection proxy. after Baidu knows it, I finally figured out a little bit by combining the following figure. To put it simply, the forward direction
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.