JP6317506B2 - Relay device, relay method, and relay program - Google Patents

Relay device, relay method, and relay program Download PDF

Info

Publication number
JP6317506B2
JP6317506B2 JP2017102440A JP2017102440A JP6317506B2 JP 6317506 B2 JP6317506 B2 JP 6317506B2 JP 2017102440 A JP2017102440 A JP 2017102440A JP 2017102440 A JP2017102440 A JP 2017102440A JP 6317506 B2 JP6317506 B2 JP 6317506B2
Authority
JP
Japan
Prior art keywords
request
response
uri
relay
reverse proxy
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2017102440A
Other languages
Japanese (ja)
Other versions
JP2017162508A (en
Inventor
三橋 薫
薫 三橋
伸啓 酒井
伸啓 酒井
高橋 宏和
宏和 高橋
聡介 鈴木
聡介 鈴木
育平 山形
育平 山形
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NTT Communications Corp
Original Assignee
NTT Communications Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NTT Communications Corp filed Critical NTT Communications Corp
Priority to JP2017102440A priority Critical patent/JP6317506B2/en
Publication of JP2017162508A publication Critical patent/JP2017162508A/en
Application granted granted Critical
Publication of JP6317506B2 publication Critical patent/JP6317506B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Transfer Between Computers (AREA)

Description

本発明は、中継装置、中継方法および中継プログラムに関する。   The present invention relates to a relay device, a relay method, and a relay program.

企業内のLANなどにおいて、インターネットに直接接続できないクライアントからのリクエストをクライアントに代わって目的のサーバに送信する処理を行うものを、一般的にはプロキシと呼ばれる。このプロキシはクライアントとインターネットとの接点に通常設置される。一方、インターネットと目的のサーバとの接点にプロキシを設置して、外部からサーバへのリクエスト要求があった場合にリクエスト先のサーバに代わって応答処理を行うものを一般的にはリバースプロキシと呼ばれる。このリバースプロキシは不特定多数のクライアントからの要求に対して、目的のサーバが本来行うはずの応答を肩代わりすることにより、目的のサーバの負担を軽減させることができる。また、リバースプロキシで目的のサーバへのアクセスを制限することにより目的のサーバのセキュリティを高めることもできる。   In a corporate LAN or the like, what performs a process of transmitting a request from a client that cannot be directly connected to the Internet to a target server on behalf of the client is generally called a proxy. This proxy is usually installed at the point of contact between the client and the Internet. On the other hand, a proxy is installed at the point of contact between the Internet and the target server, and when a request is made to the server from the outside, a response processing is performed instead of the request destination server, generally called a reverse proxy . This reverse proxy can reduce the burden on the target server by taking over the response that the target server should perform in response to requests from an unspecified number of clients. In addition, by restricting access to the target server with a reverse proxy, the security of the target server can be enhanced.

リバースプロキシに関する発明としては、たとえば、サーバによって設定されたCookieを有効に使用できるように、Set−Cookieヘッダを書き換える機能を備えたものが知られている(特許文献1)。   As an invention related to a reverse proxy, for example, an apparatus having a function of rewriting a Set-Cookie header so that a cookie set by a server can be used effectively is known (Patent Document 1).

特開2004−94905号公報JP 2004-94905 A

ところで、ユーザがWebページへアクセスする際にはWebブラウザなどのユーザエージェントにその目的となるWebサーバ(以下、目的となるWebサーバを「オリジンサーバ」という。)のURI(Uniform Resource Identifier)を指定して表示させることができる。オリジンサーバが保持しているWebページを構成する各コンテンツには、通常、起点となる現在位置から目的のファイルやフォルダまでの道筋を記述する方式(以下、この記述方式を単に「相対パス」という。)でのリンクが記述されているが、装置内の最上位階層から目的のファイルやフォルダまでのすべての道筋を記述する方式(以下、この記述方式を単に「絶対パス」という。)でのリンクが記述されている場合もある。ここで、オリジンサーバの代理としてリバースプロキシが構築されている場合であって、目的のWebページ内のコンテンツへのリンクがオリジンサーバでの絶対パスで記述されていると、リバースプロキシがオリジンサーバに対して目的のコンテンツを要求できない場合がある。以下、この不具合について具体的に説明する。   By the way, when a user accesses a Web page, a URI (Uniform Resource Identifier) of a target Web server (hereinafter referred to as “origin server”) is designated to a user agent such as a Web browser. Can be displayed. A method for describing the path from the current current position as a starting point to a target file or folder (hereinafter, this description method is simply referred to as “relative path”) for each content constituting the Web page held by the origin server. )) Is described, but the method of describing all the routes from the highest hierarchy in the device to the target file or folder (hereinafter, this description method is simply referred to as “absolute path”). In some cases, links are described. Here, if a reverse proxy is constructed on behalf of the origin server, and the link to the content in the target web page is described with an absolute path on the origin server, the reverse proxy is set to the origin server. In some cases, the target content cannot be requested. Hereinafter, this problem will be specifically described.

Webブラウザから要求されるオリジンサーバのURIには、要求の宛先となるオリジンサーバの他に、オリジンサーバおよびリバースプロキシのいずれかにて解釈される文字列が含まれている。たとえば、Webブラウザに下記の記述(1)のURIが指定されたとする。
http://www.dit.co.jp/origin/company/index.html ・・・(1)
この記述(1)に示すURIで説明すると、“/origin/company/index.html”というパス部分がオリジンサーバおよびリバースプロキシのいずれかにて解釈される文字列に相当する。また、このパス部分にオリジンサーバの識別子である“/origin”が埋め込まれていることで、リバースプロキシが「どのオリジンサーバへの要求か」を把握して、Webブラウザから要求されたコンテンツの取得先のオリジンサーバを決定することができる。つまり、記述(1)に示すURIでの“/origin”はリバースプロキシが解釈する部分であるので、オリジンサーバによって直接解釈される文字列は“/company/index.html”となる。そのため、(1)の要求をWebブラウザから受信したリバースプロキシは、要求先のオリジンサーバに対して“/origin”を削除した下記の記述(2)の要求を送信して、オリジンサーバから“index.html”を取得して、Webブラウザへ応答を返す。これにより、Webブラウザ上では“index.html”が表示されることになる。
/company/index.html ・・・(2)
The origin server URI requested from the Web browser includes a character string that is interpreted by either the origin server or the reverse proxy in addition to the origin server that is the destination of the request. For example, assume that the URI of the following description (1) is specified in the Web browser.
http://www.dit.co.jp/origin/company/index.html (1)
To explain with the URI shown in the description (1), the path portion “/origin/company/index.html” corresponds to a character string interpreted by either the origin server or the reverse proxy. In addition, the origin server identifier “/ origin” is embedded in this path part, so the reverse proxy knows which origin server it is requesting and obtains the content requested from the Web browser. The previous origin server can be determined. That is, since “/ origin” in the URI shown in the description (1) is a part that is interpreted by the reverse proxy, the character string directly interpreted by the origin server is “/company/index.html”. Therefore, the reverse proxy that has received the request of (1) from the Web browser sends a request of the following description (2) in which “/ origin” is deleted to the origin server of the request destination, and “index” is sent from the origin server. .html ”is acquired and a response is returned to the Web browser. As a result, “index.html” is displayed on the Web browser.
/company/index.html (2)

次に、Webブラウザが上記の記述(1)の要求で取得した“index.html”に記述されている画像コンテンツへのリンクが相対パスで記述されているとする。たとえば、“index.html”内に下記の記述(3)のリンクがあるとする。
<A HREF=“baz.jpg”>写真</a> ・・・(3)
そして、Webブラウザにて表示されるWebページ上でこの記述(3)に示すリンクがクリックされたとする。このとき、上記のリンクで指定された画像コンテンツについて、Webブラウザは“http://www.dit.co.jp/origin/company/”下にある“baz.jpg”であると認識するため、リバースプロキシへのURI要求は、下記の記述(4)となる。
http://www.dit.co.jp/origin/company/baz.jpg ・・・(4)
Next, it is assumed that the link to the image content described in “index.html” acquired by the request of the description (1) by the Web browser is described with a relative path. For example, it is assumed that there is a link of the following description (3) in “index.html”.
<A HREF=“baz.jpg”> Photo </a> (3)
Assume that the link shown in the description (3) is clicked on the Web page displayed on the Web browser. At this time, since the web browser recognizes “baz.jpg” under “http://www.dit.co.jp/origin/company/” for the image content specified by the above link, The URI request to the reverse proxy has the following description (4).
http://www.dit.co.jp/origin/company/baz.jpg (4)

Webブラウザから上記の記述(4)の要求を受信したリバースプロキシは、記述(4)の要求先のオリジンサーバに対して、“/origin”を削除した下記の記述(5)の要求を送信して、オリジンサーバから“baz.jpg”を取得して、Webブラウザに応答を返す。これにより、Webブラウザ上では“baz.jpg”の画像コンテンツが表示されることになる。
/company/baz.jpg ・・・(5)
The reverse proxy that has received the request of the above description (4) from the Web browser sends the request of the following description (5) from which “/ origin” has been deleted to the origin server that is the request destination of the description (4). Then, “baz.jpg” is acquired from the origin server and a response is returned to the Web browser. As a result, the image content “baz.jpg” is displayed on the Web browser.
/company/baz.jpg (5)

一方、Webブラウザが上記の記述(1)に示すURI要求で取得した“index.html”に記述されている画像コンテンツへのリンクがオリジンサーバにおける絶対パスで記述されているとする。たとえば、“index.html”内に下記の記述(6)のリンクがあるとする。
<A HREF=“/img/baz.jpg”> 写真</a> ・・・(6)
そして、Webブラウザで表示されるWebページ上でこの記述(6)のリンクがユーザによりクリックされたとする。
On the other hand, it is assumed that the link to the image content described in “index.html” acquired by the Web browser by the URI request shown in the description (1) is described by an absolute path in the origin server. For example, it is assumed that there is a link of the following description (6) in “index.html”.
<A HREF=“/img/baz.jpg”> Photo </a> (6)
Then, it is assumed that the link of the description (6) is clicked by the user on the Web page displayed by the Web browser.

Webブラウザは、上記の記述(5)のURI要求をする場合、“http://www.dit.co.jp/”に存在するコンテンツであると認識するため、リバースプロキシへのURI要求は、下記の記述(7)となる。
http://www.dit.co.jp/img/baz.jpg ・・・(7)
この記述(7)の要求を受信したリバースプロキシは、「どのオリジンサーバへの要求か」を把握するパス部分がこの要求に含まれていないため、オリジンサーバが有しているはずの“baz.jpg”を取得することができない。
Since the Web browser recognizes that the content exists in “http://www.dit.co.jp/” when making the URI request of the above description (5), the URI request to the reverse proxy is It becomes the following description (7).
http://www.dit.co.jp/img/baz.jpg (7)
The reverse proxy that has received the request of this description (7) does not include the path part for grasping “which origin server it is requested” in, so the request “baz. “jpg” cannot be obtained.

すなわち、オリジンサーバ側で保有するコンテンツのリンクが絶対パスで記述されている場合、リバースプロキシ側でどのオリジンサーバへの要求であるかを判別することができなくなり、Webブラウザからの要求を正しく転送させることができなくなる。   In other words, if the link of the content held on the origin server side is described with an absolute path, it is impossible to determine which origin server the reverse proxy side is requesting, and the request from the web browser is forwarded correctly. Can not be made.

本発明は、上述の事情に鑑みてなされたものであり、オリジンサーバ側で保有するコンテンツのリンクが絶対パスで記述されている場合であっても、オリジンサーバへと転送させることができる中継装置、中継方法および中継プログラムを提供することを目的とする。   The present invention has been made in view of the above-described circumstances, and is a relay device that can be transferred to an origin server even when a content link held on the origin server side is described with an absolute path It is an object to provide a relay method and a relay program.

上述の課題を解決するために、本発明の一側面は、中継装置に関するものである。すなわち、外部ネットワークに属するユーザエージェントからの要求を受け付けて、ユーザエージェントの要求先に応じて、内部ネットワークに属する複数のオリジンサーバのいずれかへと要求を中継する中継装置であって、要求には、ユーザエージェントに対して中継装置が予め付与した情報が記述されているヘッダ、あるいはユーザエージェントがオリジンサーバへの要求を行ったリンク元を示す情報が記述されているヘッダが含まれており、ユーザエージェントからの要求に含まれるURIと、ヘッダに含まれるURIとを比較して、ユーザエージェントからの要求に含まれるURIを書き換えるか否かを判定する判定部と、判定部の判定結果に応じてユーザエージェントからの要求に含まれるURIを書き換える処理部とを有することを特徴とする。   In order to solve the above-described problem, one aspect of the present invention relates to a relay device. That is, a relay device that accepts a request from a user agent belonging to an external network and relays the request to one of a plurality of origin servers belonging to the internal network according to the request destination of the user agent. Includes a header describing information given in advance by the relay device to the user agent, or a header describing information indicating the link source from which the user agent made a request to the origin server. A determination unit that determines whether or not to rewrite the URI included in the request from the user agent by comparing the URI included in the request from the agent with the URI included in the header, and according to the determination result of the determination unit And a processing unit that rewrites the URI included in the request from the user agent. The features.

また、上述した中継装置であって、判定部は、ユーザエージェントから送信される要求の種類に応じて、要求以前にユーザエージェントに対して中継装置が予め付与した情報が記述されているヘッダ、および要求の直前にユーザエージェントが要求を行ったリンク元を示す情報が記述されているヘッダのいずれかを参照して、ユーザエージェントからの要求に含まれるURIを書き換えるか否かを判定することができる。   Further, in the relay device described above, the determination unit, according to the type of request transmitted from the user agent, a header in which information that the relay device has previously given to the user agent before the request is described, and It is possible to determine whether or not to rewrite the URI included in the request from the user agent by referring to any of the headers describing information indicating the link source that the user agent has requested immediately before the request. .

また、上述した中継装置のいずれかであって、ユーザエージェントからの要求に中継装置が予め付与した情報が記述されているヘッダがないときは、その要求の応答をユーザエージェントに送信する際に、Set−Cookieヘッダを付与するヘッダ付与部を有し、処理部は、ユーザエージェントから、ヘッダ付与部により付与されたSet−Cookieヘッダにて指定したCookie名が含まれているCookieヘッダを有する要求があった場合に、その要求に含まれるURIの記述が、その要求のCookieヘッダに含まれるCookie名に対応するCookie値の記述で始まっていない場合には、ユーザエージェントからの要求に含まれるURIの書き換えを行うことができる。   In addition, in any of the relay devices described above, when there is no header in which the information given in advance by the relay device is included in the request from the user agent, when the response of the request is transmitted to the user agent, A header adding unit that assigns a Set-Cookie header is provided, and the processing unit receives a request from a user agent that includes a Cookie header that includes the Cookie name specified by the Set-Cookie header assigned by the header adding unit. If the URI description included in the request does not start with the description of the cookie value corresponding to the cookie name included in the cookie header of the request, the URI included in the request from the user agent is not included. Rewriting can be performed.

また、上述した中継装置のいずれかであって、判定部は、ユーザエージェントからの要求の直前にユーザエージェントがオリジンサーバへの要求を行ったリンク元を示す情報が記述されているRefererヘッダを参照し、ユーザエージェントからの要求に含まれるURIと、Refererヘッダに含まれるURIの一部とを比較して、両者が一致しない場合にユーザエージェントからの要求に含まれるURIの書き換えを行うことができる。   Also, in any of the above-described relay apparatuses, the determination unit refers to a Referer header that describes information indicating a link source from which the user agent has made a request to the origin server immediately before the request from the user agent. Then, the URI included in the request from the user agent can be rewritten by comparing the URI included in the request from the user agent with a part of the URI included in the Referer header and if the two do not match. .

また、本発明の一側面は、中継方法に関するものである。すわなち、本発明の中継方法は、外部ネットワークに属するユーザエージェントからの要求を受け付けて、ユーザエージェントの要求先に応じて、内部ネットワークに属する複数のオリジンサーバのいずれかへと要求を中継する中継方法であって、要求には、ユーザエージェントに対して中継装置が予め付与した情報が記述されているヘッダ、あるいはユーザエージェントがオリジンサーバへの要求を行ったリンク元を示す情報が記述されているヘッダが含まれており、ユーザエージェントからの要求に含まれるURIと、ヘッダに含まれるURIとを比較して、ユーザエージェントからの要求に含まれるURIを書き換えるか否かを判定する判定ステップと、判定ステップの判定結果に応じてユーザエージェントからの要求に含まれるURIを書き換える処理ステップとを有するものである。   One aspect of the present invention relates to a relay method. In other words, the relay method of the present invention receives a request from a user agent belonging to an external network, and relays the request to one of a plurality of origin servers belonging to the internal network according to the request destination of the user agent. In the relay method, the request includes a header in which information previously given by the relay device to the user agent is described, or information indicating a link source from which the user agent makes a request to the origin server. A determination step of determining whether to rewrite the URI included in the request from the user agent by comparing the URI included in the request from the user agent with the URI included in the header; The UR included in the request from the user agent according to the determination result of the determination step Those having a processing step of rewriting the.

また、本発明の一側面は、中継プログラムに関するものである。すわなち、本発明の中継プログラムは、コンピュータを、外部ネットワークに属するユーザエージェントからの要求を受け付けて、ユーザエージェントの要求先に応じて、内部ネットワークに属する複数のオリジンサーバのいずれかへと要求を中継する中継装置として機能させるための中継プログラムであって、要求には、ユーザエージェントに対して中継装置が予め付与した情報が記述されているヘッダ、あるいはユーザエージェントがオリジンサーバへの要求を行ったリンク元を示す情報が記述されているヘッダが含まれており、コンピュータを、ユーザエージェントからの要求に含まれるURIと、ヘッダに含まれるURIとを比較して、ユーザエージェントからの要求に含まれるURIを書き換えるか否かを判定する判定手段と、判定手段の判定結果に応じてユーザエージェントからの要求に含まれるURIを書き換える処理手段として機能させるためのものである。   One aspect of the present invention relates to a relay program. In other words, the relay program of the present invention receives a request from a user agent belonging to an external network, and requests a computer to one of a plurality of origin servers belonging to the internal network according to the request destination of the user agent. Is a relay program for functioning as a relay device that relays the request, and the request includes a header in which information previously given by the relay device to the user agent is described, or the user agent makes a request to the origin server Included in the request from the user agent by comparing the URI contained in the request from the user agent with the URI contained in the header. Determining means for determining whether or not to rewrite the URI, It is intended to function as processing means for rewriting the URI included in the request from the user agent in response to the means of determination results.

本発明によると、オリジンサーバ側で保有するコンテンツのリンクが絶対パスで記述されている場合であっても、ユーザエージェントからのURI要求をオリジンサーバへと転送させることができる中継装置、中継方法および中継プログラムを提供することができる。   According to the present invention, a relay device, a relay method, and a relay method capable of causing a URI request from a user agent to be transferred to an origin server even when a link of content held on the origin server side is described with an absolute path. A relay program can be provided.

本発明の第1実施形態に係るリバースプロキシサーバ10を含むパーソナルプラットフォームシステムの全体構成を示す図である。It is a figure showing the whole personal platform system composition containing reverse proxy server 10 concerning a 1st embodiment of the present invention. 図1に示すリバースプロキシサーバ10の機能的な構成を示すブロック図である。It is a block diagram which shows the functional structure of the reverse proxy server 10 shown in FIG. 図1に示すリバースプロキシサーバ10が実行する中継処理の一例を示すフローチャートである。It is a flowchart which shows an example of the relay process which the reverse proxy server 10 shown in FIG. 1 performs. 図1に示すリバースプロキシサーバ10が実行する中継処理の一例を示すフローチャートである。It is a flowchart which shows an example of the relay process which the reverse proxy server 10 shown in FIG. 1 performs. 本発明の第2実施形態に係るリバースプロキシサーバ10Aの機能的な構成を示すブロック図である。It is a block diagram which shows the functional structure of 10 A of reverse proxy servers which concern on 2nd Embodiment of this invention. 図5に示すリバースプロキシサーバ10Aが実行する中継処理の一例を示すフローチャートである。It is a flowchart which shows an example of the relay process which 10 A of reverse proxy servers shown in FIG. 5 perform. 図5に示すリバースプロキシサーバ10Aが実行する中継処理の一例を示すフローチャートである。It is a flowchart which shows an example of the relay process which 10 A of reverse proxy servers shown in FIG. 5 perform. 図1および図5で説明したリバースプロキシサーバ10,10Aのハードウェア構成の一例を示す図である。It is a figure which shows an example of the hardware constitutions of the reverse proxy servers 10 and 10A demonstrated in FIG. 1 and FIG.

以下、本発明の中継装置の一実施の形態であるリバースプロキシサーバ10,10Aについて図面を参照しながら説明する。なお、本発明の中継方法および中継プログラムについては、リバースプロキシサーバ10、10Aの動作およびリバースプロキシサーバ10,10Aにインストールされた中継プログラムを例として説明する。しかしながら、以下で説明する実施の形態は、本発明を具体化した一例であって、本発明を限定するものではない。   Hereinafter, reverse proxy servers 10 and 10A, which are an embodiment of a relay apparatus of the present invention, will be described with reference to the drawings. Note that the relay method and relay program of the present invention will be described by taking the operation of the reverse proxy servers 10 and 10A and the relay program installed in the reverse proxy servers 10 and 10A as examples. However, the embodiment described below is an example embodying the present invention, and does not limit the present invention.

[第1実施形態]
図1は、本発明の第1実施形態に係るリバースプロキシサーバ10を含むパーソナルプラットフォームシステムの全体構成を示す図である。このパーソナルプラットフォームシステムは、Webブラウザ100からインターネット110およびリバースプロキシサーバ10を介して、ユーザの宅内のLAN(Local Area Network)120に接続されている機器200A、200B、200C(以下、個々に区別する必要がない場合、単に「機器200」という。)に外部から安全にアクセスすることができるシステムである。なお、図示は省略するが、インターネット110側からリバースプロキシサーバ10へのアクセスについては、リバースプロキシサーバ10の特定のポート宛に対する通信であって、特定のIPアドレスが発信元となっている場合にのみ通信を許可する設定がなされたファイアウォールが予め構築されているものとする。
[First embodiment]
FIG. 1 is a diagram showing an overall configuration of a personal platform system including a reverse proxy server 10 according to the first embodiment of the present invention. In this personal platform system, devices 200A, 200B, and 200C connected to a LAN (Local Area Network) 120 in a user's home from the Web browser 100 via the Internet 110 and the reverse proxy server 10 (hereinafter, individually distinguished). When there is no need, it is simply a system that can safely access the “device 200” from the outside. Although illustration is omitted, access to the reverse proxy server 10 from the Internet 110 side is communication to a specific port of the reverse proxy server 10 when the specific IP address is the source. It is assumed that a firewall that is set to permit only communication is built in advance.

Webブラウザ100は、請求項に記載のユーザエージェントの一例であり、図1に示すパーソナルプラットフォームシステムのユーザが保有しているノートPCやスマートフォンなどの情報処理装置(いずれも不図示)にインストールされている。ユーザは、外出先などでWebブラウザ100を起動し、リバースプロキシサーバ10を介して外部から機器200に接続して、Webベースで閲覧可能に構築されているコンテンツ(たとえば、画像データ、映像データ、テキストデータなど)を閲覧することができる。   The Web browser 100 is an example of the user agent described in the claims, and is installed in an information processing apparatus (none of which is not shown) such as a notebook PC or a smartphone owned by the user of the personal platform system shown in FIG. Yes. The user activates the web browser 100 when away from home, connects to the device 200 from the outside via the reverse proxy server 10, and contents (for example, image data, video data, Text data, etc.).

リバースプロキシサーバ10は、請求項に記載の中継装置の一例であり、いわゆるリバースプロキシ機能を有するサーバである。リバースプロキシサーバ10は、ユーザの宅内に後述する機器200と共にLAN120に接続されており、ユーザが起動したWebブラウザ100からのURI要求を機器200に代わって応答すると共に、要求先の機器200に対してURI要求を転送して、機器200からの応答をWebブラウザ100へ返す装置である。なお、このリバースプロキシサーバ10では、機器200が外部にコンテンツを公開するためのパス名と(以下、このパス名を「公開パス名」という。)、リバースプロキシサーバ10のディレクトリ上で示される仮想的なパス名(以下、このパス名を「仮想パス名」という。)との書き換えをするための関係情報が予め設定されており、Webブラウザ100からの要求に応じて、機器200が解釈できる形式となるように適宜変換して転送するように構成されている。   The reverse proxy server 10 is an example of a relay device described in the claims, and is a server having a so-called reverse proxy function. The reverse proxy server 10 is connected to the LAN 120 together with a device 200 to be described later in the user's home, responds to the URI request from the Web browser 100 activated by the user on behalf of the device 200, and responds to the requested device 200. The device transmits a URI request and returns a response from the device 200 to the Web browser 100. In the reverse proxy server 10, a path name for the device 200 to publish content to the outside (hereinafter, this path name is referred to as “public path name”) and a virtual indicated on the directory of the reverse proxy server 10. The relationship information for rewriting with a specific path name (hereinafter, this path name is referred to as “virtual path name”) is set in advance, and can be interpreted by the device 200 in response to a request from the Web browser 100. It is configured so as to be appropriately converted and transferred so as to be in a format.

機器200は、たとえば、ネットワークカメラ、ビデオレコーダ、NAS(Network Attached Storage)などの電子機器であり、図1に示すパーソナルプラットフォームシステムを利用するユーザの宅内に構築されているLAN120に接続されている。なお、機器200は、それぞれ独自のディレクトリ構成およびコンテンツを有しており、上述した仮想パスに関連付けられた公開パス下にコンテンツが保存されており、リバースプロキシサーバ10を介して外部から接続できるように構成されている。なお、図1に示すパーソナルプラットフォームシステムでは、ユーザはLAN120に接続されている不図示のPC等からリバースプロキシサーバ10に対して機器200についての登録処理を予め実行しているものとする。   The device 200 is, for example, an electronic device such as a network camera, a video recorder, or a NAS (Network Attached Storage), and is connected to a LAN 120 that is built in a user's home using the personal platform system shown in FIG. Each device 200 has its own directory structure and content, and the content is stored under the public path associated with the virtual path described above so that it can be connected from the outside via the reverse proxy server 10. It is configured. In the personal platform system shown in FIG. 1, it is assumed that the user previously executes registration processing for the device 200 with respect to the reverse proxy server 10 from a PC (not shown) connected to the LAN 120.

図2は、図1に示すリバースプロキシサーバ10の機能的な構成を示すブロック図である。リバースプロキシサーバ10は、フィルタ部11とリバースプロキシ部12とを有している。   FIG. 2 is a block diagram showing a functional configuration of the reverse proxy server 10 shown in FIG. The reverse proxy server 10 includes a filter unit 11 and a reverse proxy unit 12.

フィルタ部11は、Webブラウザ100からの要求を受け付けると共に、受け付けた要求に含まれるURIを書き換えるか否かを判定する。また、フィルタ部11は、受け付けた要求に含まれるURIの書き換えの必要があると判定した場合には、適切なURIとなるように書き換えて後述するリバースプロキシ部12を介して機器200へと転送する。また、フィルタ部11は、リバースプロキシ部12を介して機器200から受け取った応答をWebブラウザ100へと転送する。これらの機能を実現するために、フィルタ部11は、図2に示すように、判定部21と、Cookie付与部22と、処理部23と、要求発行部24と、応答発行部25とを有している。   The filter unit 11 receives a request from the Web browser 100 and determines whether to rewrite the URI included in the received request. Further, when the filter unit 11 determines that the URI included in the received request needs to be rewritten, the filter unit 11 rewrites the URI so as to be an appropriate URI and transfers it to the device 200 via the reverse proxy unit 12 described later. To do. In addition, the filter unit 11 transfers the response received from the device 200 via the reverse proxy unit 12 to the Web browser 100. In order to realize these functions, the filter unit 11 includes a determination unit 21, a cookie granting unit 22, a processing unit 23, a request issuing unit 24, and a response issuing unit 25 as shown in FIG. doing.

判定部21は、Webブラウザ100からの要求に、後述するCookie付与部22により付与されたCookie名があるか否かを判定する。また、判定部21は、Cookie名があると判定した場合には、このCookie名が記載されているCookieヘッダに含まれるCookie値に基づいてWebブラウザ100からの要求が仮想パス名の先頭部分で始まっているか否かを更に判定して、この判定結果に応じて、受け付けた要求に含まれるURIを書き換えるか否かを決定する。   The determination unit 21 determines whether the request from the Web browser 100 includes a cookie name assigned by a cookie assignment unit 22 described later. If the determination unit 21 determines that there is a cookie name, the request from the web browser 100 is received at the head of the virtual path name based on the cookie value included in the cookie header in which the cookie name is described. It is further determined whether or not it has started, and in accordance with this determination result, it is determined whether or not to rewrite the URI included in the accepted request.

たとえば、判定部21は、Webブラウザ100からの要求に、後述するCookie付与部22により付与されたCookie名が含まれており、かつこの要求に含まれるURIがCookie値から導出される仮想パス名の先頭部分で始まっている場合には、この要求に含まれるURIを後述するリバースプロキシ部12においてそのまま解釈しても問題がないので書き換える必要がないと判断し、後述する要求発行部24へとそのまま受け渡す。   For example, the determination unit 21 includes the cookie name given by the cookie granting unit 22 described later in the request from the Web browser 100, and the virtual path name from which the URI included in the request is derived from the cookie value If the URI included in this request begins, it is determined that there is no problem even if the URI included in this request is interpreted as it is in the reverse proxy unit 12 which will be described later, and the request issuing unit 24 which will be described later is transferred. Hand it over as it is.

一方、判定部21は、Webブラウザ100からの要求に含まれるURIに、後述するCookie付与部22により付与されたCookie名があるが、この要求に含まれるURIがCookie値から導出される仮想パス名の先頭部分で始まっていない場合には、この要求に含まれるURIを後述するリバースプロキシ部12がそのまま解釈すると、どの機器200へ転送すればよいのか判断できないので、この要求に含まれるURIは書き換える必要があると判断し、後述する処理部23に対してURIの書き換え処理の実行を指示する。   On the other hand, the determination unit 21 has a cookie name given by a cookie granting unit 22 to be described later in the URI included in the request from the Web browser 100. The virtual path from which the URI included in this request is derived from the cookie value If the name does not begin with the head part of the name, the reverse proxy unit 12 described later interprets the URI included in this request as it is, so it cannot be determined to which device 200 the URI should be transferred. It is determined that rewriting is necessary, and the processing unit 23 described later is instructed to execute URI rewriting processing.

また、判定部21は、Webブラウザ100からの要求にCookieヘッダが含まれていない場合には、機器200に対して初めての接続であるか、またはCookie情報が何らかの理由で消滅していると判断し、後述するCookie付与部22に対して、この要求に対する応答のヘッダにSet-Cookieヘッダを付与するように指示をする。これにより、この要求以降に発生するWebブラウザ100からの要求に対しては後述するCookie付与部22がSet-Cookieヘッダにて指示したCookie名およびCookie値が付与されることになる。   In addition, when the cookie header is not included in the request from the Web browser 100, the determination unit 21 determines that it is the first connection to the device 200 or that the cookie information has disappeared for some reason. Then, it instructs the Cookie granting unit 22 to be described later to add a Set-Cookie header to the header of the response to this request. As a result, a Cookie name and a Cookie value specified by the Cookie giving unit 22 described later in the Set-Cookie header are given to a request from the Web browser 100 generated after this request.

Cookie付与部22は、判定部21からの指示により、Webブラウザ100からのURI要求に対する応答のヘッダにSet-Cookieヘッダを付与する。なお、このSet-Cookieヘッダにはリバースプロキシサーバ10が付与したCookie名とCookie値とが記載される。Cookie名とCookie値は、たとえば、下記の記述(8)に示すように記載される。なお、このCookie名には他のシステムが付与するCookie名と衝突しない(衝突する可能性が十分に低い)適当な文字列が設定されることが好ましい。また、Cookie値には、機器200の仮想パス名の先頭部分が得られる文字列(たとえば、“/orijin”など)が記載される。
Set-Cookie:Cookie名=Cookie値 ・・・(8)
The cookie adding unit 22 adds a Set-Cookie header to the header of a response to the URI request from the Web browser 100 according to an instruction from the determination unit 21. The Set-Cookie header describes the cookie name and the cookie value given by the reverse proxy server 10. The cookie name and the cookie value are described, for example, as shown in the following description (8). It is preferable that an appropriate character string that does not collide with the cookie name assigned by another system (the possibility of collision is sufficiently low) is set for the cookie name. In the Cookie value, a character string (for example, “/ orijin” or the like) from which the head portion of the virtual path name of the device 200 is obtained is described.
Set-Cookie: Cookie name = Cookie value (8)

処理部23は、上述した判定部21からの指示により、URI要求を書き換える処理を実行する。なお、Webブラウザ100からの要求に含まれるURIを書き換える処理については後述するフローチャート(図4)で説明する。   The processing unit 23 executes a process of rewriting the URI request according to the instruction from the determination unit 21 described above. Note that the processing for rewriting the URI included in the request from the Web browser 100 will be described with reference to a flowchart (FIG. 4) described later.

要求発行部24は、上述した処理部23により書き換えられた後のURI要求、あるいは、判定部21からそのまま受け渡されたURI要求を後述するリバースプロキシ部12へと受け渡す。   The request issuing unit 24 transfers the URI request after being rewritten by the processing unit 23 described above or the URI request transferred as it is from the determination unit 21 to the reverse proxy unit 12 described later.

応答発行部25は、後述するリバースプロキシ部12から受け渡された機器200からの応答(Webブラウザ100からのURI要求の応答に相当)をWebブラウザ100へと転送する。   The response issuing unit 25 transfers the response (corresponding to the response of the URI request from the Web browser 100) from the device 200 delivered from the reverse proxy unit 12 described later to the Web browser 100.

リバースプロキシ部12は、フィルタ部11から受け渡されたURI要求を、機器200側のディレクトリ構成にあった形式に変換して機器200へ転送すると共に、転送したURI要求に対する機器200からの応答を受け取って、フィルタ部11へと転送する機能を有している。これらの機能を実現するために、リバースプロキシ部12は、要求発行転送部31と、応答発行転送部32と、機器情報登録テーブル33とを有している。   The reverse proxy unit 12 converts the URI request received from the filter unit 11 into a format suitable for the directory structure on the device 200 side, transfers the converted request to the device 200, and sends a response from the device 200 to the transferred URI request. It has a function of receiving and transferring it to the filter unit 11. In order to realize these functions, the reverse proxy unit 12 includes a request issue transfer unit 31, a response issue transfer unit 32, and a device information registration table 33.

要求発行転送部31は、上述したフィルタ部11から受け渡されたURI要求を機器200側のディレクトリ構成にあった形式に変換したものを機器200へと転送する。具体的には、要求発行転送部31は、要求発行部24から受け渡されたURI要求が仮想パス名の場合には、後述する機器情報登録テーブル33、あるいはWebブラウザ100からの要求に含まれるCookieヘッダを参照して、転送先の機器200の仮想パス名の先頭部分に該当する文字列を除去することによって公開パス名に変換して目的の機器200へと転送する。   The request issuance transfer unit 31 transfers the URI request transferred from the filter unit 11 described above into a format suitable for the directory structure on the device 200 side, and transfers the request to the device 200. Specifically, when the URI request delivered from the request issuing unit 24 is a virtual path name, the request issue transfer unit 31 is included in a request from the device information registration table 33 or the Web browser 100 described later. With reference to the Cookie header, the character string corresponding to the head part of the virtual path name of the transfer destination device 200 is removed to convert it to a public path name and transfer it to the target device 200.

応答発行転送部32は、機器200からの応答を受信した場合に、上述したフィルタ部11へと転送する。   When the response issuance / transfer unit 32 receives a response from the device 200, the response issuance / transfer unit 32 transfers the response to the filter unit 11 described above.

機器情報登録テーブル33には、機器200の公開パス名とリバースプロキシサーバ10上の仮想パス名とを適切に書き換えるための関係情報が記憶されているテーブルである。リバースプロキシサーバ10では、機器情報登録テーブル33、あるいはWebブラウザ100からの要求に含まれるCookieヘッダを参照することにより、どの機器200に対してのURI要求であるのかを把握して、正しい転送先を決定することができる。   The device information registration table 33 is a table that stores relationship information for appropriately rewriting the public path name of the device 200 and the virtual path name on the reverse proxy server 10. In the reverse proxy server 10, the device information registration table 33 or the Cookie header included in the request from the Web browser 100 is referred to ascertain which device 200 is the URI request, and the correct transfer destination Can be determined.

(通信処理)
続いて、リバースプロキシサーバ10が実行する中継処理について説明する。なお、リバースプロキシサーバ10では、Webブラウザ100からURI要求が送信されてくると、そのURI要求にCookie付与部22により付与されたCookie名の有無に応じてその後の処理が異なるため、それぞれ別々のフローチャートを示して説明することとする。図3および図4は、図1に示すリバースプロキシサーバ10が実行する中継処理の一例を示すフローチャートである。
(Communication processing)
Next, relay processing executed by the reverse proxy server 10 will be described. In the reverse proxy server 10, when a URI request is transmitted from the Web browser 100, the subsequent processing differs depending on the presence or absence of the cookie name assigned to the URI request by the cookie granting unit 22. A flowchart will be shown and described. 3 and 4 are flowcharts illustrating an example of relay processing executed by the reverse proxy server 10 illustrated in FIG.

まず、図3に示すフローチャートを参照してWebブラウザ100からの要求に含まれるURIにCookie付与部22が予め付与するCookie名がない場合の処理を説明する。この図3に示す中継処理は、たとえば、Webブラウザ100が起動されてから機器200に初めてアクセスする場合に実行される処理手順である。   First, with reference to the flowchart shown in FIG. 3, processing when the cookie name assigned in advance by the cookie adding unit 22 is not included in the URI included in the request from the Web browser 100 will be described. The relay processing shown in FIG. 3 is a processing procedure executed when the device 200 is accessed for the first time after the Web browser 100 is activated, for example.

図3のステップS1において、Webブラウザ100は、下記の(9)のURI要求を発行して、リバースプロキシサーバ10に対してURI要求を送信する。なお、このURI要求にはリバースプロキシサーバ10を示すホスト情報として“proxy”が設定されている。
GET /origin/index.html HTTP/1.1
Host:proxy ・・・(9)
In step S <b> 1 of FIG. 3, the Web browser 100 issues a URI request (9) below, and transmits the URI request to the reverse proxy server 10. In this URI request, “proxy” is set as host information indicating the reverse proxy server 10.
GET /origin/index.html HTTP / 1.1
Host: proxy (9)

ステップS2において、リバースプロキシサーバ10のフィルタ部11は、上記の(9)のURI要求を受信すると、このURI要求にCookie付与部22がSet−Cookieヘッダにより指定した情報であるCookie名(図3ではCookie名はPとする)があるか否かを判定する。なお、この例の場合、このステップS2において、フィルタ部11により、ステップS1で送信されたURI要求に予め付与したCookie名がないと判定され、処理はステップS3に移行する。   In step S2, when the filter unit 11 of the reverse proxy server 10 receives the URI request (9) described above, the cookie name (FIG. 3), which is information specified by the Cookie granting unit 22 in the URI request by the Set-Cookie header. Then, the cookie name is P). In this example, in step S2, the filter unit 11 determines that there is no cookie name assigned in advance to the URI request transmitted in step S1, and the process proceeds to step S3.

ステップS3において、フィルタ部11は、ステップS1で送信されたURI要求については書き換える必要がないため、リバースプロキシ部12にそのまま受け渡す。   In step S <b> 3, the filter unit 11 passes the URI request transmitted in step S <b> 1 to the reverse proxy unit 12 as it is without rewriting.

ステップS4において、リバースプロキシ部12は、ステップS3でフィルタ部11から受け渡されたURI要求を、機器200のディレクトリ構成にあった形式に変換した下記の記述(10)に示すURI要求を機器200に対して発行する。具体的には、リバースプロキシサーバ10側でどの機器200であるかを判別する部分である“/origin”を除去したURI要求を機器200に対して発行する。なお、以後、このリバースプロキシサーバ10側でどの機器200であるかを判別する部分のことを「転送起点」と呼ぶことにする。
GET /index.html HTTP/1.1
Host:orijin ・・・(10)
In step S4, the reverse proxy unit 12 converts the URI request shown in the following description (10) obtained by converting the URI request passed from the filter unit 11 in step S3 into a format suitable for the directory structure of the device 200. Issued against. Specifically, a URI request from which “/ origin”, which is a part for determining which device 200 is the reverse proxy server 10 side, is issued to the device 200. Hereinafter, the part that determines which device 200 is the reverse proxy server 10 side will be referred to as a “transfer start point”.
GET /index.html HTTP / 1.1
Host: orijin (10)

ステップS5において、機器200は、ステップS4のURI要求に対する応答を発行する。具体的には、“index.html”を構成するデータをリバースプロキシサーバ10に対して送信する。   In step S5, the device 200 issues a response to the URI request in step S4. Specifically, data constituting “index.html” is transmitted to the reverse proxy server 10.

ステップS6において、リバースプロキシ部12は、ステップS5で送信された機器200からの応答を受信すると、その応答をフィルタ部11へと受け渡す。   In step S6, when receiving the response from the device 200 transmitted in step S5, the reverse proxy unit 12 passes the response to the filter unit 11.

ステップS7において、フィルタ部11は、ステップS6で受け渡された機器200からの応答は、ステップS1でWebブラウザ100が送信したURI要求に対する応答であるため、Webブラウザ100へ送信する応答ヘッダにSet-Cookieヘッダを付与したものをWebブラウザ100へと戻す。下記の記述(11)に、その一例を示す。
HTTP/1.1 200 OK
Content−Length:xxxx
Connection:close
Set−Cookie:p=/origin ・・・(11)
In step S7, since the response from the device 200 delivered in step S6 is a response to the URI request transmitted by the web browser 100 in step S1, the filter unit 11 sets Set in the response header transmitted to the web browser 100. -Return the one with the Cookie header to the Web browser 100. An example is shown in the following description (11).
HTTP / 1.1 200 OK
Content-Length: xxx
Connection: close
Set-Cookie: p = / origin (11)

上記の記述(11)に示した応答を受信したWebブラウザ100では、以後、目的の機器200へURI要求を送信する際には、このSet-Cookieヘッダにて指示された情報をCookieヘッダに付与して送信することになる。   When the Web browser 100 that has received the response shown in the above description (11) transmits a URI request to the target device 200 thereafter, the information specified in the Set-Cookie header is added to the Cookie header. And send it.

続いて、図4に示すフローチャートを参照して、Webブラウザ100からの要求に含まれるURIにCookie付与部22にて指示された情報であるCookie名がある場合の中継処理について説明する。なお、図4に示す中継処理は、上述した図3の中継処理を一度実行した後に、表示されている“index.html”というWebページ内の“index1.html”というリンクがユーザによりクリックされたものとして説明する。   Next, with reference to a flowchart shown in FIG. 4, a relay process when the Cookie name that is information instructed by the cookie giving unit 22 is included in the URI included in the request from the Web browser 100 will be described. In the relay process shown in FIG. 4, after the above-described relay process of FIG. 3 is executed once, the link “index1.html” in the displayed “index.html” Web page is clicked by the user. It will be explained as a thing.

ステップS10において、Webブラウザ100は、以下の記述(12)のURI要求をリバースプロキシサーバ10に対して送信する。なお、このステップS10に示したURI要求は、絶対パスで記載されている。また、このステップS10に示したURI要求には、リバースプロキシサーバ10から予め付与されたCookie名(“P”)が記載されたCookieヘッダと、リンク元のURI情報が記載されたRefererヘッダとが含まれている。
GET /index1.html HTTP/1.1
Host:proxy
Cookie:p=/origin
Referer:http://proxy/origin/index.html ・・・(12)
In step S <b> 10, the Web browser 100 transmits a URI request with the following description (12) to the reverse proxy server 10. The URI request shown in step S10 is described with an absolute path. In addition, the URI request shown in step S10 includes a cookie header in which a cookie name (“P”) given in advance by the reverse proxy server 10 and a referer header in which URI information of the link source is described. include.
GET /index1.html HTTP / 1.1
Host: proxy
Cookie: p = / origin
Referer: http: //proxy/origin/index.html (12)

ステップS11において、リバースプロキシサーバ10のフィルタ部11は、ステップS10で送信された要求を受信すると、この要求にCookie付与部22により予め付与したCookie名があるか否かを判定する。ステップS10で説明したように、ステップS10で送信されたURI要求には予め付与したCookie名として、“P”があるため、フィルタ部11は、更にステップS12の判定に移行する。   In step S <b> 11, when the filter unit 11 of the reverse proxy server 10 receives the request transmitted in step S <b> 10, the filter unit 11 determines whether or not there is a cookie name assigned in advance by the cookie granting unit 22 in this request. As described in step S10, since the URI request transmitted in step S10 has “P” as the cookie name assigned in advance, the filter unit 11 further proceeds to the determination in step S12.

ステップS12において、フィルタ部11は、Webブラウザ100からのURI要求(すなわち、GETメソッドで始まる部分)がCookieヘッダに記載されているCookie値から導出される仮想パス名の先頭部分で始まるか否かを判定する。この例では、Webブラウザ100からのURI要求が“/index1.html”で始まるのに対して、Cookieヘッダに記載されているCookie名“P”に対応するCookie値は“/origin”であるため、フィルタ部11はWebブラウザ100からの要求に含まれるURIがCookieヘッダに記載されているCookie値から導出される仮想パス名の先頭部分で始まっていないと判定する。そして、Cookieヘッダに記載されているCookie値から導出される仮想パス名の先頭部分である“/origin”を、上述のURI要求の先頭に挿入する。その結果、フィルタ部11は、以下の記述(13)に示すURI要求をリバースプロキシ部12に受け渡す。これにより、リバースプロキシ部12は、Webブラウザ100からの要求に含まれるURIが絶対パスで記述されていても、どの機器200に対してのURI要求であるかを知ることが可能となる。
GET /origin/index1.html HTTP/1.1
Host:proxy
Cookie:p=/origin
Referer:http://proxy/origin/index.html・・・(13)
In step S12, the filter unit 11 determines whether or not the URI request from the Web browser 100 (that is, the part starting with the GET method) starts at the head part of the virtual path name derived from the Cookie value described in the Cookie header. Determine. In this example, the URI request from the Web browser 100 starts with “/index1.html”, whereas the cookie value corresponding to the cookie name “P” described in the cookie header is “/ origin”. The filter unit 11 determines that the URI included in the request from the Web browser 100 does not start with the head part of the virtual path name derived from the Cookie value described in the Cookie header. Then, “/ origin”, which is the head part of the virtual path name derived from the Cookie value described in the Cookie header, is inserted at the head of the above-described URI request. As a result, the filter unit 11 passes the URI request shown in the following description (13) to the reverse proxy unit 12. As a result, the reverse proxy unit 12 can know which device 200 the URI is requested to even if the URI included in the request from the Web browser 100 is described with an absolute path.
GET /origin/index1.html HTTP / 1.1
Host: proxy
Cookie: p = / origin
Referer: http: //proxy/origin/index.html (13)

なお、ステップS13〜ステップS16までのリバースプロキシ部12の処理は、図3で説明したステップS4〜ステップS7までのリバースプロキシ部12の処理と同様であるため、説明を省略する。   The processing of the reverse proxy unit 12 from step S13 to step S16 is the same as the processing of the reverse proxy unit 12 from step S4 to step S7 described in FIG.

(第1実施形態の効果について)
機器200が有しているコンテンツは、通常、ユーザの宅内で閲覧されることを前提として設計されているため、必ずしも外部から参照されることを考慮して設計されているとは限らない。すなわち、コンテンツの保存場所を機器200固有のディレクトリ構成に基づいて絶対パスで記述されている場合がある。そのため、外出先などからWebブラウザ100によって閲覧する際にWebブラウザ100からのURI要求および機器200からの応答について、リバースプロキシサーバ10によって適切に変換してから転送する必要がある。
(Regarding the effect of the first embodiment)
Since the content that the device 200 has is normally designed on the assumption that it is viewed in the user's home, it is not always designed in consideration of being referred to from the outside. That is, the content storage location may be described with an absolute path based on the directory structure unique to the device 200. For this reason, when browsing the web browser 100 from an outside location, the URI request from the web browser 100 and the response from the device 200 need to be appropriately converted by the reverse proxy server 10 and transferred.

この第1実施形態におけるリバースプロキシサーバ10は、インターネット110(外部ネットワーク)に属するWebブラウザ100(ユーザエージェント)からの要求を受け付けて、Webブラウザ100の要求先に応じて、LAN120(内部ネットワーク)に属する複数の機器200(複数のオリジンサーバ)のいずれかへと要求を中継するものであり、上述の要求には、上述の要求以前にWebブラウザ100に対してリバースプロキシサーバ10のCookie付与部22がSet−Cookieヘッダにて指示した情報であるCookie名およびCookie値が含まれており、Webブラウザ100からの要求に含まれるURIと、その要求のCookieヘッダに含まれるCookie値から導出される仮想パス名の先頭部分とを比較して、Webブラウザ100からの要求に含まれるURIを書き換えるか否かを判定し、その判定結果に応じてWebブラウザ100からの要求に含まれるURIを書き換えるようにしている。これにより、このリバースプロキシサーバ10では、仮に絶対パスで記述されているリンクが機器200のコンテンツに存在していたとしても、Cookie付与部22がSet−Cookieヘッダにて予め指示したCookie名がWebブラウザ100からの要求に含まれるCookieヘッダに記述されている場合には、このCookieヘッダに含まれるCookie値から導出される仮想パス名の先頭部分をURI要求の先頭部分に挿入してからリバースプロキシ部12に受け渡し、リバースプロキシ部12においてどの機器200への要求であるかを判断してから転送することが可能になる。すなわち、このリバースプロキシサーバ10は、機器200で保有するコンテンツのリンクが絶対パスで記述されている場合であっても、Webブラウザ100からのURI要求を目的の機器200に対して転送させることができる。   The reverse proxy server 10 according to the first embodiment accepts a request from a Web browser 100 (user agent) belonging to the Internet 110 (external network), and connects to the LAN 120 (internal network) according to the request destination of the Web browser 100. The request is relayed to any of a plurality of devices 200 (a plurality of origin servers) to which the request belongs, and the cookie granting unit 22 of the reverse proxy server 10 is sent to the Web browser 100 before the request. Includes a cookie name and a cookie value, which are information indicated by the Set-Cookie header, and a virtual derived from the URI included in the request from the web browser 100 and the cookie value included in the cookie header of the request. Path name ahead By comparing the portion, so that determines whether rewrite the URI included in the request from the Web browser 100, rewrites the URI included in the request from the Web browser 100 in accordance with the determination result. Thereby, in this reverse proxy server 10, even if a link described with an absolute path exists in the content of the device 200, the cookie name designated in advance by the Cookie giving unit 22 in the Set-Cookie header is the Web If it is described in the cookie header included in the request from the browser 100, the reverse proxy is inserted after inserting the head portion of the virtual path name derived from the cookie value included in the cookie header into the head portion of the URI request. It is possible to transfer the data to the unit 12 and determine the device 200 to which the reverse proxy unit 12 determines the request. That is, the reverse proxy server 10 can transfer the URI request from the Web browser 100 to the target device 200 even when the link of the content held by the device 200 is described with an absolute path. it can.

なお、本実施形態とは異なり、Webページ内に含まれるハイパーリンクが“/”で始まっている場合には置き換えが必要と判断して、その応答の契機となったHTTP要求から補完すべき文字列(本実施形態でいえば、“/orijin”に該当するどの機器200への要求であるのかがわかる文字列)を検索して、URI要求のハイパーリンク文字列の先頭に補完するという方法も考えられるが、このような方法では、Webページ内に含まれるハイパーリンクそのものを書き換える必要がある。たとえば、JavaScriptなどで動的にハイパーリンクが生成される場合にはさらに細かい制御が必要となる。そのため、動的にハイパーリンクが生成される場合には絶対パスの置き換え判定が非常に困難になる。この点、本実施形態においては、応答の契機となったリンク元のWebページに含まれる情報を参照して操作するのではなく、リンク先への要求に含まれる情報を参照して操作を行っているため、リンク元のWebページ内に含まれるハイパーリンクそのものを書き換える必要がない。すなわち、リンク元のWebページが上述したようなJavaScriptなどで動的にハイパーリンクが生成されるものであっても、これを解釈しないで絶対パスの置き換え判定ができる構成となっている。   Unlike the present embodiment, when a hyperlink included in a Web page starts with “/”, it is determined that replacement is necessary, and characters to be complemented from the HTTP request that triggered the response. A method of searching for a column (in this embodiment, a character string that identifies which device 200 corresponds to “/ orijin”) and complementing it at the head of the hyperlink character string of the URI request is also possible. Though conceivable, in such a method, it is necessary to rewrite the hyperlink itself included in the Web page. For example, when hyperlinks are dynamically generated using JavaScript, finer control is required. Therefore, when a hyperlink is dynamically generated, it is very difficult to determine whether to replace an absolute path. In this regard, in this embodiment, the operation is performed with reference to the information included in the request to the link destination, rather than referring to the information included in the link source Web page that triggered the response. Therefore, it is not necessary to rewrite the hyperlink itself included in the link source Web page. That is, even if a hyperlink is dynamically generated by the above-described Javascript or the like on the link source Web page, the absolute path replacement determination can be performed without interpreting this.

[第2実施形態]
図5は、本発明の第2実施形態に係るリバースプロキシサーバ10Aの機能的な構成を示すブロック図である。図5に示すリバースプロキシサーバ10Aでは、本発明の第1実施形態に係るリバースプロキシサーバ10とは異なり、Cookieヘッダを用いるものではなく、Refererヘッダを用いてWebブラウザ100からのURI要求を目的の機器200へと転送させるものである。なお、Refererヘッダとは、HTTPヘッダの1つであり、インターネット上の1つのウェブページまたは1つのリソースからみて、それにリンクしているウェブページやリソースのアドレスが記載されているものである。なお、第1実施形態と同様の機能については、同一の記号を付して、その説明の一部または全部を省略する。
[Second Embodiment]
FIG. 5 is a block diagram showing a functional configuration of the reverse proxy server 10A according to the second exemplary embodiment of the present invention. Unlike the reverse proxy server 10 according to the first embodiment of the present invention, the reverse proxy server 10A shown in FIG. 5 does not use the Cookie header, but uses a Referer header to request a URI request from the Web browser 100. The data is transferred to the device 200. Note that the Referer header is one of HTTP headers, and describes the address of a web page or resource linked to one web page or one resource on the Internet. In addition, about the function similar to 1st Embodiment, the same symbol is attached | subjected and the one part or all part of the description is abbreviate | omitted.

フィルタ部11Aは、図5に示すように、判定部21Aと、処理部23と、要求発行部24と、応答発行部25、機器情報登録テーブル26とを有している。   As illustrated in FIG. 5, the filter unit 11 </ b> A includes a determination unit 21 </ b> A, a processing unit 23, a request issuing unit 24, a response issuing unit 25, and a device information registration table 26.

判定部21Aは、Webブラウザ100からのURI要求に、Refererヘッダが含まれているか否かを判定すると共に、Refererヘッダが含まれていると判定した場合には、このURI要求がRefererヘッダに記載されているURIに含まれるパス名で始まるか否かを更に判定して、この判定結果に応じて受け付けたURI要求を書き換えるか否かを決定する。   The determination unit 21A determines whether or not the Refer header is included in the URI request from the Web browser 100, and if it is determined that the Refer header is included, the URI request is described in the Refer header. It is further determined whether or not it starts with a path name included in the URI that has been set, and it is determined whether or not to rewrite the accepted URI request according to the determination result.

たとえば、判定部21Aは、Webブラウザ100からのURI要求に、Refererヘッダが含まれており、かつこのURI要求がRefererヘッダに記載されているURIに含まれるパス名と一致する場合には、このURI要求は書き換える必要がないと判断し、後述する要求発行部24へとそのまま受け渡す。   For example, when the URI request from the Web browser 100 includes a Referer header and the URI request matches the path name included in the URI described in the Referer header, the determination unit 21A It is determined that the URI request does not need to be rewritten, and is passed to the request issuing unit 24 described later.

また、判定部21Aは、Webブラウザ100からのURI要求に、Refererヘッダが含まれており、かつこのURI要求がRefererヘッダに記載されているURIに含まれるパス名と一致しない場合には、このURI要求は書き換える必要があると判断し、後述する処理部23に対してURI要求の書き換え処理の実行を指示する。   In addition, when the URI request from the Web browser 100 includes a Referer header and the URI request does not match the path name included in the URI described in the Referer header, the determination unit 21A It is determined that the URI request needs to be rewritten, and the processing unit 23 described later is instructed to execute a URI request rewriting process.

なお、判定部21Aは、Webブラウザ100からのURI要求にRefererヘッダが含まれていない場合には、Webブラウザを起動してから初めての接続であるか、またはユーザが明示的にURIを指定していると推測されるため、このURI要求をリバースプロキシ部12へそのまま受け渡す。   When the Refer header is not included in the URI request from the Web browser 100, the determination unit 21A is the first connection after starting the Web browser, or the user explicitly specifies the URI. Therefore, the URI request is transferred to the reverse proxy unit 12 as it is.

機器情報登録テーブル26には、機器200の公開パス名とリバースプロキシサーバ10上の仮想パス名とを適切に書き換えるための関係情報(たとえば上述した転送起点そのものと機器200との対応関係を示す情報など)が記憶されているテーブルである。リバースプロキシサーバ10Aでは、機器情報登録テーブル26に記憶されている関係情報を参照することにより、URIに転送起点が含まれているか否かや、どの機器200に対してのURI要求であるのかを把握して、正しい転送先を決定することができる。なお、フィルタ部11Aが有する機器情報登録テーブル26と、リバースプロキシ部12が有する機器情報登録テーブル33とは、機器200に関する同一の情報を保持しているため、フィルタ部11Aおよびリバースプロキシ部12とは独立したものとして構築してもよいし、いずれか一方に構築しておき、テーブルを保持していない方からテーブルを保持している方へ参照するような構成としてもよい。   In the device information registration table 26, relationship information for appropriately rewriting the public path name of the device 200 and the virtual path name on the reverse proxy server 10 (for example, information indicating the correspondence relationship between the transfer origin itself and the device 200 described above). Etc.) are stored in the table. In the reverse proxy server 10A, by referring to the relationship information stored in the device information registration table 26, it is determined whether or not the transfer start point is included in the URI and to which device 200 the URI request is made. It is possible to grasp and determine the correct transfer destination. The device information registration table 26 included in the filter unit 11A and the device information registration table 33 included in the reverse proxy unit 12 hold the same information regarding the device 200, and thus the filter unit 11A and the reverse proxy unit 12 May be constructed independently of each other, or may be constructed in one of them, and may be configured so as to be referred to from the person who does not hold the table to the person who holds the table.

なお、処理部23、要求発行部24、応答発行部25およびリバースプロキシ部12については、上述した第1実施形態と同様の機能を有するものであるため、説明を省略する。   Note that the processing unit 23, the request issuing unit 24, the response issuing unit 25, and the reverse proxy unit 12 have the same functions as those of the above-described first embodiment, and thus description thereof is omitted.

(通信処理)
続いて、リバースプロキシサーバ10Aが実行する中継処理について説明する。なお、リバースプロキシサーバ10Aでは、Webブラウザ100からURI要求が送信されてくると、Refererヘッダの有無に応じてその後の処理が異なるため、それぞれ別々のフローチャートを示して説明することとする。図6および図7は、図5に示すリバースプロキシサーバ10Aが実行する中継処理の一例を示すフローチャートである。
(Communication processing)
Subsequently, a relay process executed by the reverse proxy server 10A will be described. In the reverse proxy server 10A, when a URI request is transmitted from the Web browser 100, the subsequent processing differs depending on the presence or absence of the Referer header. 6 and 7 are flowcharts illustrating an example of relay processing executed by the reverse proxy server 10A illustrated in FIG.

まず、図6に示すフローチャートを参照してWebブラウザ100からのURI要求にRefererヘッダが含まれていない場合の処理を説明する。この図6に示す中継処理は、たとえば、Webブラウザ100が起動されてから初めてアクセスする場合に実行される処理手順である。   First, processing when the Refer header is not included in the URI request from the Web browser 100 will be described with reference to the flowchart shown in FIG. The relay processing shown in FIG. 6 is a processing procedure that is executed, for example, when the Web browser 100 is accessed for the first time after being activated.

図6のステップS21において、Webブラウザ100は、下記の記述(14)のURI要求をリバースプロキシサーバ10Aに対して送信する。なお、このURI要求にはリバースプロキシサーバ10Aを示すホスト情報として“proxy”が設定されている。
GET /origin/index.html HTTP/1.1
Host:proxy ・・・(14)
In step S21 of FIG. 6, the Web browser 100 transmits a URI request having the following description (14) to the reverse proxy server 10A. In this URI request, “proxy” is set as host information indicating the reverse proxy server 10A.
GET /origin/index.html HTTP / 1.1
Host: proxy (14)

ステップS22において、リバースプロキシサーバ10Aのフィルタ部11Aは、上記の(14)のURI要求を受信すると、このURI要求にRefererヘッダがあるか否かを判定する。このステップS22において、フィルタ部11Aは、ステップS21で送信されたURI要求にRefererヘッダがないと判定してステップS23に移行する。   In step S <b> 22, when the filter unit 11 </ b> A of the reverse proxy server 10 </ b> A receives the URI request (14), the filter unit 11 </ b> A determines whether there is a Referer header in the URI request. In step S22, the filter unit 11A determines that there is no Referer header in the URI request transmitted in step S21, and proceeds to step S23.

ステップS23において、フィルタ部11Aは、ステップS21で送信されたURI要求については書き換える必要がないため、リバースプロキシ部12にそのまま受け渡す。   In step S23, the filter unit 11A passes the URI request transmitted in step S21 to the reverse proxy unit 12 as it is without rewriting.

ステップS24において、リバースプロキシ部12は、ステップS23でフィルタ部11Aから受け渡されたURI要求を、機器200のディレクトリ構成にあった形式に変換した下記の記述(15)に示すURI要求を機器200に対して発行する。具体的には、リバースプロキシサーバ10A側でどの機器200であるかを判別する部分(すなわち、上述した第1実施形態で説明した転送起点)である/originを除去したURI要求を機器200に対して発行する。
GET /index.html HTTP/1.1
Host:orijin ・・・(15)
In step S24, the reverse proxy unit 12 converts the URI request shown in the following description (15) obtained by converting the URI request passed from the filter unit 11A in step S23 into a format suitable for the directory structure of the device 200. Issued against. Specifically, a URI request from which / origin, which is a part for determining which device 200 is the reverse proxy server 10A side (that is, the transfer start point described in the first embodiment described above) is removed, is sent to the device 200. Issue.
GET /index.html HTTP / 1.1
Host: orijin (15)

ステップS25において、機器200は、ステップS24のURI要求に対する応答を発行する。具体的には、“index.html”を構成するデータをリバースプロキシサーバ10Aに対して送信する。   In step S25, the device 200 issues a response to the URI request in step S24. Specifically, data constituting “index.html” is transmitted to the reverse proxy server 10A.

ステップS26において、リバースプロキシ部12は、ステップS25で送信された機器200からの応答を受信すると、その応答をフィルタ部11Aへと受け渡す。   In step S26, when receiving the response from the device 200 transmitted in step S25, the reverse proxy unit 12 passes the response to the filter unit 11A.

ステップS27において、フィルタ部11Aは、ステップS26で受け渡された機器200からの応答をWebブラウザ100へと戻す。下記の記述(16)に、その一例を示す。
HTTP/1.1 200 OK
Content−Length:xxxx
Connection:close・・・(16)
In step S27, the filter unit 11A returns the response from the device 200 delivered in step S26 to the web browser 100. An example is shown in the following description (16).
HTTP / 1.1 200 OK
Content-Length: xxx
Connection: close (16)

続いて、図7に示すフローチャートを参照して、Webブラウザ100からのURI要求にRefererヘッダが含まれている場合の中継処理について説明する。なお、図7に示す中継処理は、表示されている“index.html”というWebページ内の“index1.html”というリンクがユーザによりクリックされたものとして説明する。   Next, a relay process when the Refer header is included in the URI request from the Web browser 100 will be described with reference to the flowchart shown in FIG. The relay process shown in FIG. 7 will be described on the assumption that the user clicked on the link “index1.html” in the displayed webpage “index.html”.

ステップS30において、Webブラウザ100は、以下の記述(17)のURI要求をリバースプロキシサーバ10Aに対して送信する。なお、このステップS30に示したURI要求は、絶対パスで記載されている。また、このステップS30に示したURI要求には、リンク元のURI情報が記載されたRefererヘッダとが含まれている。
GET /index1.html HTTP/1.1
Host:proxy
Referer:http://proxy/origin/index.html ・・・(17)
In step S30, the Web browser 100 transmits a URI request having the following description (17) to the reverse proxy server 10A. The URI request shown in step S30 is described with an absolute path. Further, the URI request shown in step S30 includes a Referer header in which URI information of the link source is described.
GET /index1.html HTTP / 1.1
Host: proxy
Referer: http: //proxy/origin/index.html (17)

ステップS31において、リバースプロキシサーバ10Aのフィルタ部11Aは、ステップS30で送信されたURI要求を受信すると、このURI要求に判定部22AによりRefererヘッダがあるか否かを判定する。ステップS30で説明したように、ステップS30で送信されたURI要求にはRefererヘッダがあるため、フィルタ部11Aは、更にステップS32の判定に移行する。   In step S31, when the filter unit 11A of the reverse proxy server 10A receives the URI request transmitted in step S30, the determination unit 22A determines whether or not there is a Referer header in the URI request. As described in step S30, since the URI request transmitted in step S30 includes a Referer header, the filter unit 11A further proceeds to the determination in step S32.

ステップS32において、フィルタ部11Aは、Webブラウザ100からのURI要求(すなわち、GETメソッドで始まる部分)がRefererヘッダに記載されているURIの絶対パス部分が転送起点と一致するか否かを判定する。この例では、Webブラウザ100からのURI要求が“/index1.html”であるのに対して、Refererヘッダに記載されているURIの絶対パス部分は、“/origin”であるため、フィルタ部11AはWebブラウザ100からの要求に含まれるURIとRefererヘッダに記載されているURIの絶対パス部分とは一致していない(すなわち、両者の転送起点は一致していない)と判定する。そして、ステップS33において、フィルタ部11Aは、Refererヘッダに記載されているURIの絶対パス部分(すわなち、“/origin”)を、上述のWebブラウザ100からの要求に含まれるURIの先頭に挿入して要求を発行する。その結果、フィルタ部11Aは、以下の記述(18)のURI要求をリバースプロキシ部12に受け渡す。これにより、リバースプロキシ部12は、Webブラウザ100からの要求に含まれるURIが絶対パスで記述されていても、どの機器200に対してのURI要求であるかを知ることが可能となる。
GET /origin/index1.html HTTP/1.1
Host:proxy
Referer:http://proxy/origin/index.html ・・・(18)
In step S32, the filter unit 11A determines whether the URI request from the Web browser 100 (that is, the part starting with the GET method) matches the absolute path part of the URI described in the Referer header. . In this example, the URI request from the Web browser 100 is “/index1.html”, whereas the absolute path portion of the URI described in the Referer header is “/ origin”, so the filter unit 11A Determines that the URI included in the request from the Web browser 100 and the absolute path portion of the URI described in the Referer header do not match (that is, the transfer start point of both does not match). In step S33, the filter unit 11A sets the absolute path portion (that is, “/ origin”) of the URI described in the Referer header at the head of the URI included in the request from the Web browser 100 described above. Insert and issue request. As a result, the filter unit 11A passes the URI request of the following description (18) to the reverse proxy unit 12. As a result, the reverse proxy unit 12 can know which device 200 the URI is requested to even if the URI included in the request from the Web browser 100 is described with an absolute path.
GET /origin/index1.html HTTP / 1.1
Host: proxy
Referer: http: //proxy/origin/index.html (18)

なお、ステップS34〜ステップS37までのリバースプロキシ部12の処理は、図3で説明したステップS14〜ステップS17までのリバースプロキシ部12の処理と同様であるため、説明を省略する。   Note that the processing of the reverse proxy unit 12 from step S34 to step S37 is the same as the processing of the reverse proxy unit 12 from step S14 to step S17 described in FIG.

(第2実施形態の効果について)
この第2実施形態におけるリバースプロキシサーバ10Aでは、インターネット110(外部ネットワーク)に属するWebブラウザ100(ユーザエージェント)からの要求を受け付けて、Webブラウザ100の要求先に応じて、LAN120(内部ネットワーク)に属する複数の機器200(複数のオリジンサーバ)のいずれかへと要求を中継するものであり、上述の要求には、Webブラウザ100からの要求の直前にWebブラウザ100が機器200への要求を行ったリンク元を示す情報が記述されているRefererヘッダが含まれており、Webブラウザ100からの要求に含まれるURIと、Refererヘッダに含まれるURIとを比較して、Webブラウザ100からの要求に含まれるURIを書き換えるか否かを判定し、その判定結果に応じてWebブラウザ100からの要求に含まれるURIを書き換えるようにしている。これにより、リバースプロキシサーバ10Aは、仮に絶対パスで記述されているリンクが機器200のコンテンツに存在していたとしても、Refererヘッダを参照してWebブラウザ100の要求直前のURIを参照することにより、絶対パスで記述されているURIの先頭部分にリバースプロキシサーバ10Aで解釈するためのパス部分を挿入することができる。その結果、リバースプロキシ部12においてどの機器200への要求であるかを判断して転送することができる。すなわち、機器200で保有するコンテンツのリンクが絶対パスで記述されている場合であっても、Webブラウザ100からのURI要求を目的の機器200に対して転送させることができる。
(About effects of the second embodiment)
In the reverse proxy server 10A according to the second embodiment, a request from a web browser 100 (user agent) belonging to the Internet 110 (external network) is accepted, and the request is made to the LAN 120 (internal network) according to the request destination of the web browser 100. The request is relayed to any of a plurality of devices 200 (a plurality of origin servers) to which the web browser 100 belongs, and in the above request, the web browser 100 makes a request to the device 200 immediately before the request from the web browser 100. A Referer header in which information indicating the link source is described is included. The URI included in the request from the Web browser 100 is compared with the URI included in the Referer header. Whether to rewrite the included URI Determined, so that rewrite the URI included in the request from the Web browser 100 in accordance with the determination result. Thereby, the reverse proxy server 10A refers to the URI immediately before the request of the Web browser 100 by referring to the Referer header even if the link described in the absolute path exists in the content of the device 200. The path portion for interpretation by the reverse proxy server 10A can be inserted at the head portion of the URI described by the absolute path. As a result, the reverse proxy unit 12 can determine which device 200 the request is for and transfer the request. That is, even when the content link held by the device 200 is described with an absolute path, the URI request from the Web browser 100 can be transferred to the target device 200.

(その他の実施の形態)
上述した各実施の形態は、その要旨を逸脱しない限り、様々に変更が可能である。たとえば、第1実施形態におけるリバースプロキシサーバ10の機能と第2実施形態のリバースプロキシサーバ10Aの両方の機能を併せ持ち、Webブラウザ100からの要求の種類に応じて、どちらの機能により判定するかを決定するように構成してもよい。たとえば、Webブラウザ100からGETメソッドの要求が送信されてきた場合には、第2実施形態におけるリバースプロキシサーバ10Aの機能により、Refererヘッダの有無に応じてURIの書き換え判定を行うように構成すると共に、Webブラウザ100からPOSTメソッドの要求が送信されてきた場合には、第1実施形態におけるリバースプロキシサーバ10の機能により、Cookieヘッダに含まれているCookie名が一致するか否かを判定するようにしてもよい。このような構成とすることにより、たとえば、Refererヘッダの有無による判定を採用した場合(すなわち、リバースプロキシサーバ10Aが有する機能による判定を採用した場合)に大量のデータを2回アップロードしなければならなくなるという問題を解消することができる。これは、Refererでは孫参照ができないため、リバースプロキシサーバ10Aの応答で「301 Moved Permanently」などの応答を使って対処したい場合に発生する問題である。リバースプロキシサーバ10Aが1回目のHTTP要求に対して301応答を返すと、Webブラウザ100は、その301応答に含まれるLocation行で指定された宛先に対して2回目のHTTP要求を発行することになる。そして、2回目のHTTP要求の宛先からその応答として200(OK)応答が返り、Webブラウザ100の要求は完了する。この動作自体はPOSTメソッドでもGETメソッドでも同じであるが、GETメソッドは1回の要求で数十からせいぜい数百文字を送信するのに対し、POSTメソッドはより多くの文字を送信することが前提となっているため、Webブラウザ100がたとえば数百万文字を2回送るということが発生し、送信データ量が非常に多くなってしまうことが考えられる。そこで、POSTメソッドの要求の場合には、Cookieヘッダに基づく判定を採用し(すなわち、リバースプロキシサーバ10が有する機能による判定)301応答を使用しなくても応答できるようにし、POSTメソッド以外の要求の場合にはRefererヘッダの有無による判定とすることで、上述した送信データ量が非常に多くなってしまうという問題を解決することができる。
(Other embodiments)
Each embodiment described above can be variously modified without departing from the gist thereof. For example, it has both the functions of the reverse proxy server 10 in the first embodiment and the reverse proxy server 10A in the second embodiment, and which function is used for determination according to the type of request from the Web browser 100. You may comprise so that it may determine. For example, when a request for the GET method is transmitted from the Web browser 100, the function of the reverse proxy server 10A in the second embodiment is configured to make a URI rewrite determination according to the presence or absence of the Referer header. When a POST method request is transmitted from the Web browser 100, the function of the reverse proxy server 10 in the first embodiment determines whether or not the Cookie names included in the Cookie header match. It may be. With such a configuration, for example, when determination based on the presence or absence of a Referer header is adopted (that is, determination based on the function of the reverse proxy server 10A is adopted), a large amount of data must be uploaded twice. The problem of disappearing can be solved. This is a problem that occurs when it is desired to deal with the response of the reverse proxy server 10A by using a response such as “301 Moved Permanently” because the Referer cannot refer to the grandchild. When the reverse proxy server 10A returns a 301 response to the first HTTP request, the Web browser 100 issues a second HTTP request to the destination specified in the Location line included in the 301 response. Become. Then, a 200 (OK) response is returned as the response from the destination of the second HTTP request, and the request of the Web browser 100 is completed. This operation itself is the same for both the POST method and the GET method. However, the GET method transmits several tens to at most several hundred characters in one request, whereas the POST method transmits more characters. Therefore, it may occur that the web browser 100 sends millions of characters twice, for example, and the amount of transmission data becomes very large. Therefore, in the case of a request for the POST method, determination based on the Cookie header is adopted (that is, determination based on the function of the reverse proxy server 10) so that the response can be made without using the 301 response. In this case, the determination based on the presence or absence of the Referer header can solve the above-described problem that the amount of transmission data becomes very large.

また、上述した第1実施形態では、リバースプロキシサーバ10がWebブラウザ100への応答ヘッダにCookie名を付与しているため、機器200側(オリジンサーバ側)でもCookieを付与する構成の場合には、これらのCookieの間で、名前の衝突が起きないように適切な文字列を選択する必要がある。そのような可能性がある場合には、たとえば、リバースプロキシサーバ10側で付与するCookie名、あるいは機器200側で付与するCookie名について一意に識別できるようにルールを設けるようにしてもよい。   In the first embodiment described above, since the reverse proxy server 10 assigns a cookie name to the response header to the Web browser 100, in the case where the device 200 side (origin server side) also assigns a cookie. Therefore, it is necessary to select an appropriate character string so that name collision does not occur between these cookies. If there is such a possibility, for example, a rule may be provided so that the cookie name assigned on the reverse proxy server 10 side or the cookie name assigned on the device 200 side can be uniquely identified.

また、上述した図3に示すフローチャートのステップS2において、Cookie名を持たない要求URIは、通常、この要求以前にリバースプロキシサーバ10へのアクセスをしていない状況であると考えられるが、このほかにも、Cookieの有効期限が切れた等でCookieが破棄された後に、ユーザがWebページ内に表示されているリンクをクリックしたという可能性も考えられる。Webブラウザ100においてCookieが破棄されている場合、リバースプロキシサーバ10は、要求URIに示される絶対パスで指定されている自己のフォルダの参照を試みるが、典型的には当該リソースが存在しないという404エラー(Not Found)が発生する。なお、リバースプロキシサーバ10に設定されている仮想パスのトップレベル毎にアクセス認証を行っている場合には、401エラー(Unauthrized)が発生する。このような場合には、Webブラウザ100側でもう一度リンク元へのURI要求を行うことで、リバースプロキシサーバ10はCookie名を有する要求として判定するため、その後に正しいリンク先へのアクセスが可能となる。   In addition, in step S2 of the flowchart shown in FIG. 3 described above, the request URI that does not have a cookie name is normally considered to be a situation in which the reverse proxy server 10 is not accessed before this request. In addition, there is a possibility that the user clicked a link displayed in the web page after the cookie was discarded due to expiration of the cookie. If the cookie is discarded in the Web browser 100, the reverse proxy server 10 tries to refer to its own folder specified by the absolute path indicated in the request URI, but typically 404 that the resource does not exist. An error (Not Found) occurs. When access authentication is performed for each top level of the virtual path set in the reverse proxy server 10, a 401 error (Unauthorized) occurs. In such a case, by making another URI request to the link source on the Web browser 100 side, the reverse proxy server 10 determines that the request has a cookie name, so that it is possible to access the correct link destination thereafter. Become.

また、上述した図3に示すフローチャートのステップS3において、リバースプロキシサーバ10側での仮想パス名と機器200側の公開パス名が同一の場合、判定が正しくできない可能性がある。たとえば、機器200に“/foo/img/baz.jpg”というフォルダ構成およびファイルが存在し、そこへ機器200内の絶対パス指定がなされている場合を想定する。ここで、リバースプロキシサーバ10では
http://proxy/foo/bar.html
への要求があると
http://origin/bar.html
に転送される場合に、この“bar.html”に
<A HREF=/foo/img/baz.jpg>
というハイパーリンクがあった場合(a)と、
<A HREF=./img/baz.jpg>
というハイパーリンクがあった場合(b)は、いずれもWebブラウザ100からは以下の記述(19)のような要求が発行されることになる。
GET /foo/img/baz.jpg HTTP/1.1
HOST :proxy
Cookie:p=/foo ・・・(19)
リバースプロキシサーバ10側では、この要求が上述の(a)か(b)のいずれであるかの区別がつかないが、(a)は置き換えを発生させるべきであり、(b)は置き換えを発生させるべきではない。このような事象を回避させるためには、リバースプロキシサーバ10での仮想パス名と機器200側の公開パス名の衝突が起きないように、仮想パス名には、たとえばGUIDなどの衝突の可能性が低い文字列を使用することが好ましい。なお、公開パス名についても同様にたとえばGUIDなどの衝突の可能性が低い文字列を使用することが好ましい。
Further, in step S3 of the flowchart shown in FIG. 3 described above, if the virtual path name on the reverse proxy server 10 side and the public path name on the device 200 side are the same, the determination may not be made correctly. For example, it is assumed that the device 200 has a folder structure and file “/foo/img/baz.jpg”, and an absolute path in the device 200 is specified there. Here, in the reverse proxy server 10
http: //proxy/foo/bar.html
When there is a request to
http: //origin/bar.html
To “bar.html”
<A HREF=/foo/img/baz.jpg>
When there is a hyperlink (a),
<A HREF=./img/baz.jpg>
(B), a request such as the following description (19) is issued from the Web browser 100.
GET /foo/img/baz.jpg HTTP / 1.1
HOST: proxy
Cookie: p = / foo (19)
On the reverse proxy server 10 side, it cannot be distinguished whether the request is (a) or (b) described above, but (a) should cause a replacement, and (b) caused a replacement. Should not be allowed to In order to avoid such an event, the virtual path name may have a collision such as a GUID so that the virtual path name in the reverse proxy server 10 and the public path name on the device 200 side do not collide. It is preferable to use a character string having a low. Similarly, for the public path name, it is preferable to use a character string having a low possibility of collision such as GUID.

なお、上述した例での要求ヘッダ行は、RFC2616、RFC2396でいう絶対パス(abs_path)形式となっているが、規格上は絶対URI(absoluteURI)の可能性もある。即ち、
GET http://proxy/foo/img/baz.jpg HTTP1.1 ・・・(20)
あるいは
GET http://proxy:80/foo/img/baz.jpg HTTP1.1 ・・・(21)
などの可能性もあるが、上記の記述(20)や記述(21)の場合も(a)と(b)の区別ができない点には変わりがない。なお、リバースプロキシサーバ10の判定において、通常は(a)と判定するが、リバースプロキシサーバ10で仮想パスが有効であった場合には、(b)と判定するようなオプション機能を設けるようにしてもよい。このようオプション機能を具備することで、(a)と(b)ともに有効なリソースであっても一方しか参照されないが、どちらを参照するかを選ぶことが可能である。
Note that the request header line in the above-described example is in the absolute path (abs_path) format referred to in RFC 2616 and RFC 2396, but there is a possibility of an absolute URI (absolute URI) in the standard. That is,
GET http: //proxy/foo/img/baz.jpg HTTP1.1 (20)
Or GET http: // proxy: 80 / foo / img / baz.jpg HTTP1.1 (21)
In the case of the above description (20) and description (21), there is no difference in that (a) and (b) cannot be distinguished. In the determination of the reverse proxy server 10, normally (a) is determined, but when the virtual path is valid in the reverse proxy server 10, an optional function for determining (b) is provided. May be. By providing such an optional function, even if both (a) and (b) are valid resources, only one of them is referred to, but it is possible to select which one to refer to.

また、上述した図4に示すフローチャートのステップS12においてURI要求で指定されたファイル名が省略されている場合も考えられる。
たとえば、下記の記述(22)に示すように
GET /dir/ HTTP1.1
HOST :proxy
Cookie :p=/foo ・・・(22)
という要求の場合には、リバースプロキシサーバ10のフィルタ部11で“/foo/dir”を参照するように書き換えることが好ましい。
In addition, there may be a case where the file name specified in the URI request in step S12 in the flowchart shown in FIG. 4 is omitted.
For example, as shown in the description (22) below, GET /dir/HTTP1.1
HOST: proxy
Cookie: p = / foo (22)
In the case of the request, it is preferable to rewrite the filter unit 11 of the reverse proxy server 10 so as to refer to “/ foo / dir”.

また、下記の記述(23)に示すように
GET / HTTP1.1
HOST :proxy
Cookie :p=/foo ・・・(23)
という要求の場合には、リバースプロキシサーバ10のフィルタ部11で“/foo/”を参照するように書き換えることが好ましい。
Also, as shown in the description (23) below, GET / HTTP1.1
HOST: proxy
Cookie: p = / foo (23)
In the case of the request, it is preferable to rewrite so that “/ foo /” is referred to by the filter unit 11 of the reverse proxy server 10.

また、URI要求が絶対URI(absoluteURI)だった場合、たとえば下記の記述(24)に示すように、
GET http://proxy/img/baz.jpg HTTP1.1
HOST :proxy
Cookie :p=/foo ・・・(24)
という要求の場合には、リバースプロキシサーバ10のフィルタ部11で
“http://proxy/foo/img/baz.jpg”を参照するように書き換えることが好ましい。
Further, when the URI request is an absolute URI (absolute URI), for example, as shown in the following description (24),
GET http: //proxy/img/baz.jpg HTTP1.1
HOST: proxy
Cookie: p = / foo (24)
In the case of the request, it is preferable to rewrite so that “http: //proxy/foo/img/baz.jpg” is referred to by the filter unit 11 of the reverse proxy server 10.

また、絶対パス(abs_path)部分が空の場合、たとえば下記の記述(25)に示すように、
GET http://proxy HTTP1.1
HOST :proxy
Cookie :p=/foo ・・・(25)
という要求の場合にはリバースプロキシサーバ10のフィルタ部11で
“http://proxy/foo”を参照するように書き換えることが好ましい。
If the absolute path (abs_path) portion is empty, for example, as shown in the following description (25),
GET http: // proxy HTTP1.1
HOST: proxy
Cookie: p = / foo (25)
In the case of the request, it is preferable to rewrite so that “http: // proxy / foo” is referred to by the filter unit 11 of the reverse proxy server 10.

また、上述した第2実施形態におけるリバースプロキシサーバ10Aでは、Refererヘッダを解析することで、機器200への公開パスを得ている。しかしながら、RefererヘッダとしてはRFC2616/RFC2396でいう絶対URI(abusoluteURI)が指定される以外にも、仕様上は相対URI(relativeURI)となる可能性もある。たとえば、下記の記述(26),(27),(28)などである。
Referer://proxy/foo/bar.html ・・・(26)
Referer:/foo/bar.html ・・・(27)
Referer:bar.html ・・・(28)
上記の記述(26)、(27)、(28)のような場合、リバースプロキシサーバ10Aは、Webブラウザ100からの要求URIに含まれる他の情報から不足部分を補って判断することが好ましい。
Further, the reverse proxy server 10A in the second embodiment described above obtains a public path to the device 200 by analyzing the Referer header. However, in addition to the absolute URI (abusolute URI) referred to in RFC 2616 / RFC 2396 being specified as the Referer header, there is a possibility that it becomes a relative URI (relative URI) in terms of specifications. For example, the following descriptions (26), (27), and (28) are included.
Referer: //proxy/foo/bar.html (26)
Referer: /foo/bar.html (27)
Referer: bar.html (28)
In the case of the above descriptions (26), (27), and (28), it is preferable that the reverse proxy server 10 </ b> A makes a determination by supplementing the lacking part from other information included in the request URI from the Web browser 100.

また、上述した第2実施形態におけるリバースプロキシサーバ10Aでは、判定が正しくできない可能性がある。たとえば、機器200の“/bar.html”に“/baz.html”へのハイパーリンクがあり、“/baz.html”に“/img/qux.jpg”へのハイパーリンクがある場合を考える。“/bar.html”を参照したWebブラウザ100が“/baz.html”を要求する場合、リバースプロキシサーバ10AへのURI要求は以下の記述(29)となる。
GET /baz.html HTTP1.1
HOST :proxy
Referer :http://proxy/foo/bar.html ・・・(29)
ここで、リバースプロキシサーバ10AではWebブラウザ100からの要求URIの書き換えを行うと、以下の記述(30)となる。
GET /foo/baz.html HTTP1.1
HOST :orijin
Referer :http://proxy/foo/bar.html ・・・(30)
リバースプロキシサーバ10Aは上記の記述(30)という要求を機器200へ送信して、“/baz.html”を取得する。そして、その後にWebブラウザ100において“/baz.html”に含まれる“/img/qux.jpg”の絶対パスで記載されているハイパーリンクを辿って“qux.jpg”を参照する場合、Webブラウザ100から以下の記述(31)の要求が生成される。
GET /img/qux.jpg HTTP1.1
HOST :proxy
Referer :http://proxy/baz.html ・・・(31)
上記の記述(31)のRefererヘッダに示されるように、“/foo”が含まれていないので、上述した図7のステップS32で説明した判定では、要求URIの転送起点に該当するものがなく、この判定を実行する前提としての比較要件が満たされていないため、書き換えが行われなくなってしまう。これは、“/baz.html”の参照に際して、Webブラウザ100はあくまでも“http://proxy/baz.html”から辿ったと判断しているためである。そのため、リバースプロキシサーバ10Aを正しく動作させるためには、Webブラウザ100に対して、この要求URIで指定している“/baz.html”は、実際には“http://proxy/foo/baz.html”にあることを通知しなければならない。
In addition, the reverse proxy server 10A in the second embodiment described above may not be able to make a determination correctly. For example, consider a case where “/bar.html” of the device 200 has a hyperlink to “/baz.html” and “/baz.html” has a hyperlink to “/img/qux.jpg”. When the Web browser 100 referring to “/bar.html” requests “/baz.html”, the URI request to the reverse proxy server 10A has the following description (29).
GET /baz.html HTTP1.1
HOST: proxy
Referer: http: //proxy/foo/bar.html (29)
When the reverse proxy server 10A rewrites the request URI from the Web browser 100, the following description (30) is obtained.
GET /foo/baz.html HTTP1.1
HOST: orijin
Referer: http: //proxy/foo/bar.html (30)
The reverse proxy server 10A transmits the request of the above description (30) to the device 200 and acquires “/baz.html”. Then, when the web browser 100 refers to “qux.jpg” by following the hyperlink described by the absolute path “/img/qux.jpg” included in “/baz.html”, the web browser From 100, a request of the following description (31) is generated.
GET /img/qux.jpg HTTP1.1
HOST: proxy
Referer: http: //proxy/baz.html (31)
As shown in the Referer header of the above description (31), since “/ foo” is not included, the determination described in step S32 of FIG. 7 described above does not correspond to the transfer origin of the request URI. Since the comparison requirement as a premise for executing this determination is not satisfied, rewriting is not performed. This is because, when referring to “/baz.html”, it is determined that the Web browser 100 has traced from “http: //proxy/baz.html”. Therefore, in order for the reverse proxy server 10A to operate correctly, “/baz.html” specified in the request URI for the Web browser 100 is actually “http: // proxy / foo / baz”. You must be informed that it is in .html ”.

HTTPには、このようなURIが変わった旨をリバースプロキシサーバ10AからWebブラウザ100に通知する応答コード(たとえば、301(Moved Permanently)、302(Found)、305(Use Proxy)、307(Temporary Redirect)など)が定義されている。HTTPのバージョンやWebブラウザ100によりどの応答コードで対応可能であるかについて差異があるため、要求元のHTTPバージョンやUserAgent行を見てどの応答コードを返すのかについて適宜分岐して応答を返すように設定する必要がある。なお、いずれの応答コードの場合も応答ヘッダのLocation行に変更後のURIを記載する。たとえば、以下の記述(32)に示すような応答ヘッダを生成する。
HTTP/1.1 307 Temporary Redirect
Date:Fri,18 May 2012 01:05:07 GMT
Location:http://proxy/foo/img/baz.jpg
Connection:Close ・・・(32)
In HTTP, a response code (for example, 301 (Moved Permanently), 302 (Found), 305 (Use Proxy), 307 (Temporary Redirect) for notifying the Web browser 100 that the URI has changed is shown in HTTP. ) Etc.) are defined. Since there is a difference in which response code can be supported by the HTTP version and the Web browser 100, the response is returned by appropriately branching which response code is returned by looking at the HTTP version of the request source and the UserAgent line. Must be set. For any response code, the changed URI is written in the Location line of the response header. For example, a response header as shown in the following description (32) is generated.
HTTP / 1.1 307 Temporary Redirect
Date: Fri, 18 May 2012 01:05:07 GMT
Location: http: //proxy/foo/img/baz.jpg
Connection: Close (32)

また、上述した実施の形態で説明したリバースプロキシサーバ10,10A及びこれらの変形例において実行される処理のすべてまたは一部をプログラムによって構成し、これらのプログラムを実行可能な状態で記録した媒体からコンピュータに直接インストールする、またはネットワーク経由で遠隔にあるコンピュータにインストールすることもできる。   In addition, the reverse proxy servers 10 and 10A described in the above-described embodiment and all or a part of the processes executed in these modified examples are configured by a program, and the program is recorded in an executable state. It can also be installed directly on a computer or on a computer remotely over a network.

図8は、図1および図5で説明したリバースプロキシサーバ10,10Aのハードウェア構成の一例を示す図である。上述したリバースプロキシサーバ10,10A及びこれらの変形例で構成されるコンピュータでは、CPU301が、たとえば、記憶部308に記憶されている中継プログラムを、入出力インタフェース304およびバス305を介して、RAM103にロードして実行することにより、上述した一連の処理が行われる。   FIG. 8 is a diagram illustrating an example of a hardware configuration of the reverse proxy servers 10 and 10A described in FIG. 1 and FIG. In the computer constituted by the above-described reverse proxy servers 10 and 10A and modifications thereof, the CPU 301 transfers, for example, the relay program stored in the storage unit 308 to the RAM 103 via the input / output interface 304 and the bus 305. By loading and executing, the above-described series of processing is performed.

コンピュータ(CPU301)が実行する中継プログラムは、たとえば、磁気ディスク(フレキシブルディスクを含む)、光ディスク(CD-ROM(Compact Disc-Read Only Memory),DVD(Digital Versatile Disc)等)、光磁気ディスク、もしくは半導体メモリなどよりなるパッケージメディアであるリムーバブルメディア311に記録して、あるいは、ローカルエリアネットワーク、インターネット、デジタル衛星放送といった、有線または無線の伝送媒体を介して提供される。   The relay program executed by the computer (CPU 301) is, for example, a magnetic disk (including a flexible disk), an optical disk (CD-ROM (Compact Disc-Read Only Memory), DVD (Digital Versatile Disc), etc.), a magneto-optical disk, or It is recorded on a removable medium 311 that is a package medium made of a semiconductor memory or the like, or provided via a wired or wireless transmission medium such as a local area network, the Internet, or digital satellite broadcasting.

そして、中継プログラムは、リムーバブルメディア311をドライブ310に装着することにより、入出力インタフェース304を介して、記憶部308にインストールすることができる。また、中継プログラムは、有線または無線の伝送媒体を介して、通信部309で受信し、記憶部308にインストールすることができる。その他、プログラムは、ROM302や記憶部308に、あらかじめインストールしておくことができる。   The relay program can be installed in the storage unit 308 via the input / output interface 304 by attaching the removable medium 311 to the drive 310. The relay program can be received by the communication unit 309 via a wired or wireless transmission medium and installed in the storage unit 308. In addition, the program can be installed in the ROM 302 or the storage unit 308 in advance.

なお、コンピュータが実行する中継プログラムは、本明細書で説明する順序に沿って時系列に処理が行われるプログラムであっても良いし、並列に、あるいは呼び出しが行われたとき等の必要なタイミングで処理が行われるプログラムであっても良い。さらに、中継プログラムは、遠方のコンピュータに転送されて実行されるものであっても良い。また、中継プログラムを実行するハードウェアとして、汎用コンピュータの他に、上述したリバースプロキシサーバ10,10A及びこれらの変形例の機能を備えているものであれば、他の電子機器上に構成されるものであってもよい。   Note that the relay program executed by the computer may be a program that is processed in time series in the order described in this specification, or in parallel or at a necessary timing such as when a call is made. It may be a program in which processing is performed. Furthermore, the relay program may be transferred to a remote computer and executed. Further, as hardware for executing the relay program, in addition to the general-purpose computer, if the reverse proxy servers 10 and 10A described above and the functions of these modifications are provided, they are configured on other electronic devices. It may be a thing.

10,10A…リバースプロキシサーバ(中継装置の一例)、11,11A…フィルタ部、12…リバースプロキシ部、21,21A…判定部、22…Cookie付与部、23…処理部、24…要求発行部、25…応答発行部、26…機器情報登録テーブル、31…要求発行転送部、32…応答発行転送部、33…機器情報登録テーブル、100…Webブラウザ(ユーザエージェントの一例)、110…インターネット、200,200A,200B,2000C…機器(オリジンサーバの一例)   DESCRIPTION OF SYMBOLS 10,10A ... Reverse proxy server (an example of a relay apparatus) 11, 11, A ... Filter part, 12 ... Reverse proxy part, 21, 21A ... Determination part, 22 ... Cookie grant part, 23 ... Processing part, 24 ... Request issue part 25 ... Response issuing unit, 26 ... Device information registration table, 31 ... Request issue transfer unit, 32 ... Response issue transfer unit, 33 ... Device information registration table, 100 ... Web browser (an example of user agent), 110 ... Internet, 200, 200A, 200B, 2000C ... equipment (an example of an origin server)

Claims (4)

外部ネットワークに属するユーザエージェントからの要求に応じて、内部ネットワークに属する複数の機器のいずれかへと前記要求を中継すると共に、その中継された機器からの応答を前記ユーザエージェントへ転送する中継装置であって、
前記中継装置は、
前記要求を書き換えるか否かを判定する判定部と、
前記判定部が書き換える必要があると判定した場合には前記要求を書き換える処理部と、
前記複数の機器が有しているコンテンツを公開するための公開パス名と、前記中継装置のディレクトリ上で示される仮想的なパス名との関係情報が記憶されている機器情報登録テーブルと、
前記機器情報登録テーブルの仮想的なパス名を参照して、要求先の機器およびその機器の公開パス名を特定し、前記要求を前記機器側のディレクトリ構成にあった形式に変換して要求先の前記機器へと転送する要求発行転送部と、
要求先の前記機器から応答を受信した場合に、その応答を前記フィルタ部へと転送する応答発行転送部と、
を有することを特徴とする中継装置。
In response to a request from a user agent belonging to an external network, a relay device that relays the request to one of a plurality of devices belonging to the internal network and forwards a response from the relayed device to the user agent. There,
The relay device is
A determination unit for determining whether to rewrite the request;
A processing unit that rewrites the request when it is determined that the determination unit needs to be rewritten;
A device information registration table in which relation information between a public path name for publishing contents possessed by the plurality of devices and a virtual path name indicated on the directory of the relay device is stored;
Referring to the virtual path name in the device information registration table, the request destination device and the public path name of the device are specified, and the request is converted into a format suitable for the directory structure on the device side. A request issuance transfer unit for transferring to the device;
A response issuance transfer unit that, when receiving a response from the requested device, transfers the response to the filter unit;
A relay apparatus comprising:
請求項1に記載の中継装置であって、
前記要求には、前記ユーザエージェントが前記機器への要求を行ったリンク元を示す情報が記述されているRefererヘッダが含まれており、
前記判定部は、
前記要求に含まれるURIと、前記Refererヘッダに含まれるURIの一部とを比較して、両者が一致しない場合に前記要求の書き換えを行うと判定する
ことを特徴とする中継装置。
The relay device according to claim 1,
The request includes a Referer header in which information indicating a link source from which the user agent makes a request to the device is described.
The determination unit
A relay apparatus comprising: comparing a URI included in the request with a part of a URI included in the Referer header, and determining that the request is to be rewritten when the two do not match.
外部ネットワークに属するユーザエージェントからの要求に応じて、内部ネットワークに属する複数の機器のいずれかへと前記要求を中継すると共に、その中継された機器からの応答を前記ユーザエージェントへ転送する中継装置が実行する中継方法であって、
前記要求を書き換えるか否かを判定する判定ステップと、
前記判定ステップにおいて書き換える必要があると判定した場合には前記要求を書き換える書き換えステップと、
前記複数の機器が有しているコンテンツを公開するための公開パス名と、前記中継装置のディレクトリ上で示される仮想的なパス名との関係情報が記憶されている機器情報登録テーブルを参照して、前記書き換えステップにより書き換えられた前記要求に含まれる仮想的なパス名から要求先の機器およびその機器の公開パス名を特定し、前記要求を前記機器側のディレクトリ構成にあった形式に変換して要求先の前記機器へと転送する要求発行転送ステップと、
要求先の前記機器から応答を受信した場合に、その応答を前記フィルタ部へと転送する応答発行転送ステップと、
ことを特徴とする中継方法。
In response to a request from a user agent belonging to an external network, a relay device relays the request to any of a plurality of devices belonging to the internal network and forwards a response from the relayed device to the user agent. A relay method to execute,
A determination step of determining whether to rewrite the request;
A rewriting step for rewriting the request when it is determined that it is necessary to rewrite in the determination step;
Refer to the device information registration table in which the relationship information between the public path name for publishing the contents possessed by the plurality of devices and the virtual path name indicated on the directory of the relay device is stored. The requesting device and the public path name of the device are identified from the virtual path name included in the request rewritten by the rewriting step, and the request is converted into a format suitable for the directory structure on the device side. And a request issuance transfer step for transferring to the requesting device.
A response issuance transfer step for transferring the response to the filter unit when a response is received from the requested device;
A relay method characterized by the above.
コンピュータを、外部ネットワークに属するユーザエージェントからの要求に応じて、内部ネットワークに属する複数の機器のいずれかへと前記要求を中継すると共に、その中継された機器からの応答を前記ユーザエージェントへ転送する中継装置として機能させるためのプログラムであって、
前記コンピュータを、
前記要求を書き換えるか否かを判定する判定部と、
前記判定部が書き換える必要があると判定した場合には前記要求を書き換える処理部と、
前記複数の機器が有しているコンテンツを公開するための公開パス名と、前記中継装置のディレクトリ上で示される仮想的なパス名との関係情報が記憶されている機器情報登録テーブルと、
前記機器情報登録テーブルの仮想的なパス名を参照して、要求先の機器およびその機器の公開パス名を特定し、前記要求を前記機器側のディレクトリ構成にあった形式に変換して要求先の前記機器へと転送する要求発行転送部と、
要求先の前記機器から応答を受信した場合に、その応答を前記フィルタ部へと転送する応答発行転送部と、
して機能させるためのプログラム。
In response to a request from a user agent belonging to an external network, the computer relays the request to one of a plurality of devices belonging to the internal network, and forwards a response from the relayed device to the user agent. A program for functioning as a relay device,
The computer,
A determination unit for determining whether to rewrite the request;
A processing unit that rewrites the request when it is determined that the determination unit needs to be rewritten;
A device information registration table in which relation information between a public path name for publishing contents possessed by the plurality of devices and a virtual path name indicated on the directory of the relay device is stored;
Referring to the virtual path name in the device information registration table, the request destination device and the public path name of the device are specified, and the request is converted into a format suitable for the directory structure on the device side. A request issuance transfer unit for transferring to the device;
A response issuance transfer unit that, when receiving a response from the requested device, transfers the response to the filter unit;
Program to make it function.
JP2017102440A 2017-05-24 2017-05-24 Relay device, relay method, and relay program Active JP6317506B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2017102440A JP6317506B2 (en) 2017-05-24 2017-05-24 Relay device, relay method, and relay program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2017102440A JP6317506B2 (en) 2017-05-24 2017-05-24 Relay device, relay method, and relay program

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2012269391A Division JP6151508B2 (en) 2012-12-10 2012-12-10 Relay device, relay method, and relay program

Related Child Applications (1)

Application Number Title Priority Date Filing Date
JP2018064325A Division JP6608476B2 (en) 2018-03-29 2018-03-29 Relay device, relay method, and relay program

Publications (2)

Publication Number Publication Date
JP2017162508A JP2017162508A (en) 2017-09-14
JP6317506B2 true JP6317506B2 (en) 2018-04-25

Family

ID=59857993

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2017102440A Active JP6317506B2 (en) 2017-05-24 2017-05-24 Relay device, relay method, and relay program

Country Status (1)

Country Link
JP (1) JP6317506B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113742631B (en) * 2021-09-22 2024-04-19 焦点科技股份有限公司 CDN-based website picture anti-theft chain method
US20230247081A1 (en) * 2022-01-31 2023-08-03 Salesforce.Com, Inc. Declarative rendering of hypertext transfer protocol headers

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4186164B2 (en) * 2004-05-31 2008-11-26 日本電気株式会社 Web sharing system, Web sharing method, Web sharing program, relay server, and WWW browser display device
JP5488349B2 (en) * 2010-08-30 2014-05-14 富士通株式会社 Relay device, relay method, and relay program

Also Published As

Publication number Publication date
JP2017162508A (en) 2017-09-14

Similar Documents

Publication Publication Date Title
US7716282B2 (en) Proxy server apparatus and method for providing service using the same
JP4758362B2 (en) Relay device, program, and relay method
RU2689439C2 (en) Improved performance of web access
US20130262696A1 (en) Proxy server apparatus, client terminal apparatus, remote access system, transfer control method, access method, and recording medium
JP2003044385A (en) Trusted internet clipboard
JP5488349B2 (en) Relay device, relay method, and relay program
US9712523B2 (en) Secure transfer of web application client persistent state information into a new domain
US20120015602A1 (en) Relay device, relay method, and relay device control program
JP5347429B2 (en) Uniform resource locator rewriting method and apparatus
JP6317506B2 (en) Relay device, relay method, and relay program
JP2006018795A (en) Web sharing system, web sharing method, web sharing program, relay server, and www browser display device
JP6151508B2 (en) Relay device, relay method, and relay program
JP6608476B2 (en) Relay device, relay method, and relay program
JP5495188B2 (en) Web service providing system, server device, method and program
JP2013250691A (en) Communication device and method
US20070124445A1 (en) Browser adaptation for context based navigation
KR100987768B1 (en) Method and apparatus for processing large amount cookie
JP5332117B2 (en) WWW content acquisition system and WWW content acquisition method
JP4882738B2 (en) Client device, communication method, and program
JP2002236662A (en) Information processing system and authentication server program
WO2014030487A1 (en) Proxy server, operation control method thereof, and operation control program thereof
JP2010181946A (en) Communication system, terminal equipment, content obtaining method, and program
JP2005260571A (en) Communication relay device, communication relay method, and communication relay program
JP4983924B2 (en) COMMUNICATION SYSTEM, COMMUNICATION OPTIMIZATION DEVICE, AND COMMUNICATION NETWORK ESTIMATING METHOD USED FOR THEM
JPH11175448A (en) Data repeater system and information terminal equipment and request repeater system and computer readable record medium for recording data relay program and information reading program

Legal Events

Date Code Title Description
A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20170621

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20170621

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20170609

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20180227

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20180329

R150 Certificate of patent or registration of utility model

Ref document number: 6317506

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250