Customize the system and method for http proxy content
Technical field
The present invention relates to a kind of system and methods for customizing http proxy content.
Background technique
Domestic consumer is that each class of electronic devices in family is enable to share internet link, it will usually buy wireless routing
Device.Therefore, all access for internet of user will pass through router, and operator can be by being arranged in router
Http proxy caching resets the specified URL content returned, such as former advertisement can be replaced with router confession
Answer quotient's advertisement.
Therefore, a kind of system and method for customizing http proxy content is needed at present.
Summary of the invention
The purpose of the present invention is to provide a kind of system and methods for customizing http proxy content can be the URL's of request
Returned content is reset to customization http proxy content, one or a set of URL to be replaced is replaced into target URL, and can be with
The regularly configuration information that mode needs to update to server inquiry, and according to the update configuration information of configuration information server
Feedback dynamic updates configuration information.
To solve the above problems, the present invention provides the system of a customization http proxy content, comprising:
Router, the URL for acquisition request;
The proxy server being built on the router, for storing the configuration information of customization http proxy content, and
Customization http proxy content is generated according to the URL of request and the configuration information.
Further, in above system, the configuration information includes:
URL to be replaced and/or URL regular expression to be replaced;
Target URL, as the URL of the request and the URL to be replaced and/or URL regular expression matching to be replaced,
The URL of the request is replaced with into target URL;
Customization http proxy content corresponding with the target URL.
It further, further include a configuration information server in above system, for storing customization http proxy content
Configuration information, and the request of Receiving Agent server update configuration information, according to the request for updating configuration information to institute
It states proxy server and sends the feedback for updating configuration information.
Further, in above system, the proxy server is also used to send more to the configuration information server
The request of new configuration information.
Further, in above system, the proxy server is taken according to Fixed Time Interval to the configuration information
Business device sends the request for updating configuration information.
Another side according to the present invention provides a kind of customization http generation of system using above-mentioned customization http proxy content
The method for managing content, comprising:
It is built in the configuration information of the proxy server storage customization http proxy content on the router;
The URL of router acquisition request;
The proxy server generates customization http proxy content according to the URL of request and the configuration information.
Further, in the above-mentioned methods, the configuration information includes URL to be replaced and/or URL regular expressions to be replaced
Formula, target URL and customization http proxy content corresponding with the target URL.
Further, in the above-mentioned methods, the proxy server generates fixed according to the URL of request and the configuration information
The step of http proxy content processed includes:
As the URL of the request and the URL to be replaced and/or URL regular expression matching to be replaced, asked by described in
The URL asked replaces with target URL;
Corresponding customization http proxy content is generated according to the target URL.
Further, in the above-mentioned methods, the proxy server storage customization http agency being built on the router
The step of configuration information of content includes:
The configuration information of one configuration information server storage customization http proxy content;
The proxy server sends the request for updating configuration information to the configuration information server;
The configuration information server, which is sent according to the request for updating configuration information to the proxy server, to be updated
The feedback of configuration information.
Further, in the above-mentioned methods, the proxy server takes according to Fixed Time Interval to the configuration information
Business device sends the request for updating configuration information.
Compared with prior art, the present invention passes through the URL of router acquisition request, the agency being built on the router
Server generates customization http proxy content according to the URL of request and the configuration information, realizes in the return the URL of request
Appearance is reset to customization http proxy content.
In addition, URL and the URL to be replaced and/or URL regular expression matching to be replaced by working as the request
When, the URL of the request is replaced with into target URL, supports the displacement of URL content, one or a set of URL to be replaced can be replaced
For target URL.
Match confidence in addition, sending to update to the configuration information server according to Fixed Time Interval by proxy server
The request of breath, configuration information server, which is sent according to the request for updating configuration information to the proxy server, updates configuration
The feedback of information, proxy server regularly mode can carry out inquiry to server and need the configuration information that updates, and according to
The feedback dynamic of the update configuration information of configuration information server updates configuration information.
Detailed description of the invention
Fig. 1 is the module diagram of the system of the customization http proxy content of the embodiment of the present invention one;
Fig. 2 is the module diagram of the system of the customization http proxy content of the embodiment of the present invention two;
Fig. 3 is the flow chart of the method for the customization http proxy content of the embodiment of the present invention three;
Fig. 4 is the flow chart of the method for the customization http proxy content of the embodiment of the present invention four.
Specific embodiment
In order to make the foregoing objectives, features and advantages of the present invention clearer and more comprehensible, with reference to the accompanying drawing and specific real
Applying mode, the present invention is described in further detail.
Embodiment one
As shown in Figure 1, the present invention also provides a kind of systems for customizing http proxy content, including router 1 and it is built in
Proxy server 2 on the router.
Router 1 is used for the URL of acquisition request.
Proxy server 2 is used to store the configuration information for customizing http proxy content, and according to the URL of request and described matches
Confidence breath generates customization http proxy content.
Preferably, the configuration information includes:
URL to be replaced and/or URL regular expression to be replaced;
Target URL, as the URL of the request and the URL to be replaced and/or URL regular expression matching to be replaced,
The URL of the request is replaced with into target URL;
Customization http proxy content corresponding with the target URL.
The present embodiment is based on http agent skill group, regular expression matching technology, in an agency built in router interior
Server (http proxy server), proxy server can consult the configuration information of storage, and the URL of the request is replaced
For target URL, realizes and the returned content of the URL of request is reset to customization http proxy content, it is such as real based on URL displacement
Existing advertising business.
Embodiment two
As shown in Fig. 2, the present invention also provides a kind of systems for customizing http proxy content, including router 1, it is built in institute
The proxy server 2 and configuration information server 3 on router are stated, the difference between this embodiment and the first embodiment lies in increasing one
Configuration information server 3, proxy server regularly mode can carry out inquiring the configuration information for needing to update to server, and
Configuration information is updated according to the feedback dynamic of the update configuration information of configuration information server.
Router 1 is used for the URL of acquisition request.
Proxy server 2 is used to store the configuration information for customizing http proxy content, and according to the URL of request and described matches
Confidence breath generates customization http proxy content.
Configuration information server 3 is used to store the configuration information of customization http proxy content, and Receiving Agent server is more
The request of new configuration information sends to the proxy server according to the request for updating configuration information and updates configuration information
Feedback.
The proxy server 2, which is also used to send to the configuration information server 3, to be updated the request of configuration information and connects
Receive the feedback for updating configuration information, wherein the proxy server is according to Fixed Time Interval to the configuration information server
It sends the request for updating configuration information and receives the feedback for updating configuration information, i.e., proxy server 2 is according to Fixed Time Interval
If 30 minutes query configuration information servers are primary, when the configuration information updated if necessary, configuration information server 3 is to described
Proxy server 2 send institute the configuration information of update in need feedback, proxy server 2 receive configuration information server 3 need
After the feedback for the configuration information to be updated, is indicated to update the configuration information in memory according to feedback, configuration information is made to come into force.
Preferably, the configuration information includes:
URL to be replaced and/or URL regular expression to be replaced;
Target URL, as the URL of the request and the URL to be replaced and/or URL regular expression matching to be replaced,
The URL of the request is replaced with into target URL;
Customization http proxy content corresponding with the target URL.
The present embodiment is based under http agent skill group, regular expression matching technology and configuration information server configuration dynamic
Characteristic is sent out, in a proxy server (http proxy server) built in router interior, proxy server is storable to be looked into
Configuration information is read, the URL of the request is replaced into target URL, realizes the returned content of the URL of request to be reset to and determines
Http proxy content processed, such as based on URL displacement realize advertising business, proxy server can regularly mode to server into
The configuration information that row inquiry needs to update, and updated and configured according to the feedback dynamic of the update configuration information of configuration information server
Information.
Embodiment three
As shown in figure 3, the present invention provides a kind of determining for the system of customization http proxy content using above-described embodiment one
The method of http proxy content processed, comprising:
Step S11 is built in the configuration information of the proxy server storage customization http proxy content on the router;
Preferably, the configuration information include URL to be replaced and/or URL regular expression to be replaced, target URL and with
The corresponding customization http proxy content of the target URL.
Step S12, the URL of router acquisition request;
Step S13, the proxy server generate in customization http agency according to the URL of request and the configuration information
Hold.
Preferably, step S13 includes:
Step S131, when the URL and the URL to be replaced of the request and/or URL regular expression matching to be replaced
When, the URL of the request is replaced with into target URL;
Step S132 generates corresponding customization http proxy content according to the target URL.
The present embodiment is based on http agent skill group, regular expression matching technology, in an agency built in router interior
Server (http proxy server), proxy server can consult the configuration information of storage, and the URL of the request is replaced
For target URL, realizes and the returned content of the URL of request is reset to customization http proxy content, it is such as real based on URL displacement
Existing advertising business.
Example IV
As shown in figure 4, the present invention provides a kind of determining for the system of customization http proxy content using above-described embodiment two
The difference of the method for http proxy content processed, the present embodiment and example IV be proxy server can regularly mode to clothes
Business device carries out the configuration information that inquiry needs to update, and more according to the feedback dynamic of the update configuration information of configuration information server
New configuration information, which comprises
Step S21, the configuration information of configuration information server storage customization http proxy content;
Step S22, the proxy server send the request for updating configuration information to the configuration information server,
In, the proxy server according to Fixed Time Interval to the configuration information server send update configuration information request and
The feedback for updating configuration information is received, i.e., proxy server is according to Fixed Time Interval such as 30 minutes query configuration information servers
Once, when the configuration information updated if necessary, configuration information server sends institute's update in need to the proxy server
Configuration information feedback, after proxy server receives the feedback of configuration information that configuration information server needs to update, according to
Feedback instruction updates the configuration information in memory, and configuration information is made to come into force;
Step S23 updates the request of configuration information described in the configuration information server Receiving Agent server, according to institute
State the feedback for updating the request of configuration information to proxy server transmission update configuration information;
Preferably, the configuration information include URL to be replaced and/or URL regular expression to be replaced, target URL and with
The corresponding customization http proxy content of the target URL.
Step S24, the URL of router acquisition request;
Step S25, the proxy server generate in customization http agency according to the URL of request and the configuration information
Hold.
Preferably, step S25 includes:
Step S251, when the URL and the URL to be replaced of the request and/or URL regular expression matching to be replaced
When, the URL of the request is replaced with into target URL;
Step S252 generates corresponding customization http proxy content according to the target URL.
The present embodiment is based on http agent skill group, regular expression matching technology, in an agency built in router interior
Server (http proxy server), proxy server can consult the configuration information of storage, and the URL of the request is replaced
For target URL, realizes and the returned content of the URL of request is reset to customization http proxy content, it is such as real based on URL displacement
Existing advertising business.
The present embodiment is based under http agent skill group, regular expression matching technology and configuration information server configuration dynamic
Characteristic is sent out, in a proxy server (http proxy server) built in router interior, proxy server is storable to be looked into
Configuration information is read, the URL of the request is replaced into target URL, realizes the returned content of the URL of request to be reset to and determines
Http proxy content processed, such as based on URL displacement realize advertising business, proxy server can regularly mode to server into
The configuration information that row inquiry needs to update, and updated and configured according to the feedback dynamic of the update configuration information of configuration information server
Information.
In conclusion the present invention passes through the URL of router acquisition request, the proxy server being built on the router
Customization http proxy content is generated according to the URL of request and the configuration information, is realized the returned content of the URL of request again
It is set as customizing http proxy content.In addition, passing through the URL and the URL to be replaced and/or URL to be replaced that work as the request
When regular expression matching, the URL of the request is replaced with into target URL, supports the displacement of URL content, it can be by one or one
Group URL to be replaced is replaced into target URL.In addition, being taken according to Fixed Time Interval to the configuration information by proxy server
Device of being engaged in sends the request for updating configuration information, and configuration information server is according to the request for updating configuration information to the agency
Server send update configuration information feedback, proxy server can regularly mode to server carry out inquiry need to update
Configuration information, and according to configuration information server update configuration information feedback dynamic update configuration information.
Each embodiment in this specification is described in a progressive manner, the highlights of each of the examples are with other
The difference of embodiment, the same or similar parts in each embodiment may refer to each other.For system disclosed in embodiment
For, due to corresponding to the methods disclosed in the examples, so being described relatively simple, related place is referring to method part illustration
?.
Professional further appreciates that, unit described in conjunction with the examples disclosed in the embodiments of the present disclosure
And algorithm steps, can be realized with electronic hardware, computer software, or a combination of the two, in order to clearly demonstrate hardware and
The interchangeability of software generally describes each exemplary composition and step according to function in the above description.These
Function is implemented in hardware or software actually, the specific application and design constraint depending on technical solution.Profession
Technical staff can use different methods to achieve the described function each specific application, but this realization is not answered
Think beyond the scope of this invention.
Obviously, those skilled in the art can carry out various modification and variations without departing from spirit of the invention to invention
And range.If in this way, these modifications and changes of the present invention belong to the claims in the present invention and its equivalent technologies range it
Interior, then the invention is also intended to include including these modification and variations.