Using GlobalLink Web Proxy X Headers
Headers injected by the GlobalLink Web Proxy
Most clients do not need to distinguish between a request coming directly from a browser and a request coming through GlobalLink Web Proxy. Some clients, however, want to adjust the behavior of their web servers by determining the geo-location of end-user requests coming from GlobalLink Web Proxy. By using the web server programming environment, clients can distinguish direct requests from those coming from GlobalLink Web Proxy through the REQUEST HEADER. GlobalLink Web Proxy requests have these additional header parameters:
X-OriginalHost- set to the virtual host of the original request to GlobalLink Web Proxy (example: es.example.com).
X-OriginalPort- set to the original port number that the browser used to connect to the proxy (usually the same port that the proxy uses to connect to the origin server).
X-OriginalIP- set to the browsers IP address (note that the origin servers IIS or Apache logs will only have the IP address of GlobalLink Web Proxy and this header item can be used to see the IP address of the original request). We also provide the industry standard X header: X-Forwarded-For.
X-OriginalLang- set to the ISO language of the proxy's translation engine (example: ES represents Spanish).
X-OriginalLocale - set to the ISO language and country code pair of the proxy's translation engine (example: ES-US represents Spanish for US).
Here are some server-side code examples for extracting the original IP address from the request header using X-OriginalIP:
ASP
Dim xoip xoip = Request.ServerVariables ("X-OriginalIp")
Java/Servlet JSP
String xoip = request.getHeader("X-OriginalIp");
Perl
$xoip = $ENV{"X-OriginalIp"};
PHP
$xoip = $_SERVER ["X-OriginalIp"];
About UTIC
UTIC is an expression format that allows you to identify specific content on your site. For example, the format allows you to specify all tags or every HTML tag with the id of “foo”.
The UTIC has four values delimited by a semi-colon:
Type of value | Description | Associated MIME Types | Example Value | |
---|---|---|---|---|
U | URL | The URL of a node. The URL can be expressed as a full URL (www.example.com/foo.html), as a relative path (/home/about/foo.html), or as a regular expressions (foo*.html). | HTML, XML, JavaScript, JSON, text | foo.html |
T | Tag Stack | The structural location of a node | HTML, XML, JSON, text | /div/p |
I | ID Stack | The location of a node with respect to its id attributes | HTML, XML | /foo/bar/ |
C | Class Stack | The location of a node with respect to its class attributes | HTML, XML | /foo/bar/ |
In addition, the UTIC syntax includes the following features:
- A capital U,T,I, or C denotes a wildcard value (i.e. matches any value for that type).
- A UTIC comprised of all letters is called an “open UTIC” and will apply to every available case.
- A non-wildcard value will match only in the event of a complete match of the substring (the value of U,T,I, or C) against the input string (the URL, Tag stack, ID stack, or Class stack). For example, "foo;T;I;C;" will match any URL containing the string “foo”. (Note: this is strstr matching in C++)
- Not every type of value applies to a given mime type. (For example, JSON data doesn't have a class stack)
Response Headers You Can Use to Alter Proxy Behavior
You can also use the following response X-Headers to specify content that should not translated.
X-OneLinkNoTx - Identifies specific content that should not be translated.
For example, if you want to prevent translation of the content in tags you would set the following response header:
X-OneLinkNoTx: U;/meta/;I;C
The X-OneLinkNoTx header uses a special type of notation, called UTIC, to identify specific blocks of content that are used for processing. In this case, you are specifying the content of your tags.