Monthly Archives: June 2016
A proxy server is a computer that offers a computer network service to allow clients to make indirect network connections to other network services. A client connects to the proxy server, then requests a connection, file, or other resource available on a different server. The proxy provides the resource either by connecting to the specified server or by serving it from a cache. In some cases, the proxy may alter the client’s request or the server’s response for various purposes.
A common proxy application is a caching Web proxy. This provides a nearby cache of Web pages and files available on remote Web servers, allowing local network clients to access them more quickly or reliably.
When it receives a request for a Web resource (specified by a URL), a caching proxy looks for the resulting URL in its local cache. If found, it returns the document immediately. Otherwise it fetches it from the remote server, returns it to the requester and saves a copy in the cache. The cache usually uses an expiry algorithm to remove documents from the cache, according to their age, size, and access history. Two simple cache algorithms are Least Recently Used (LRU) and Least Frequently Used (LFU). LRU removes the least-recently used documents, and LFU removes the least-frequently used documents.
Web proxies can also filter the content of Web pages served. Some censorware applications – which attempt to block offensive Web content – are implemented as Web proxies. Other web proxies reformat web pages for a specific purpose or audience; for example, Skweezer reformats web pages for cell phones and PDAs. Network operators can also deploy proxies to intercept computer viruses and other hostile content served from remote Web pages.
A special case of web proxies are “CGI proxies.” These are web sites which allow a user to access a site through them. They generally use PHP or CGI to implement the proxying functionality. CGI proxies are frequently used to gain access to web sites blocked by corporate or school proxies. Since they also hide the user’s own IP address from the web sites they access through the proxy, they are sometimes also used to gain a degree of anonymity.
You may see references to four different types of proxy servers:
This type of proxy server identifies itself as a proxy server and also makes the original IP address available through the http headers. These are generally used for their ability to cache websites and do not effectively provide any anonymity to those who use them. However, the use of a transparent proxy will get you around simple IP bans. They are transparent in the terms that your IP address is exposed, not transparent in the terms that you do not know that you are using it (your system is not specifically configured to use it.)
This type of proxy server identifies itself as a proxy server, but does not make the original IP address available. This type of proxy server is detectable, but provides reasonable anonymity for most users.
This type of proxy server identifies itself as a proxy server, but make an incorrect original IP address available through the http headers.
High Anonymity Proxy
This type of proxy server does not identify itself as a proxy server and does not make available the original IP address.
A 6-year-old boy was seen in a physician’s office for possible pneumonia. According to his mother, the child had been coughing and wheezing for the past 6 days. In addition, the mother stated that the child had a temperature of 103.9°F (39.9°C), decreased oral intake for the last 3 days, and decreased urine output for 2 days. The child had been treated with home albuterol nebulizers and antibiotics for 3 days. Over the last 24 hours, the child developed nausea, vomiting, and diarrhea. A sibling in the house had been diagnosed with bronchitis.
The child’s past medical history included neurofibromatosis, asthma, seizure disorder, attention-deficit/hyperactivity disorder, and pneumonia. The child had a prior workup that showed negative results for hyperglycemia. Current medications included methylphenidate, 20 mg twice per day; the albuterol nebulizer treatments; and amoxicillin, 250 mg 3 times per day. He had no known drug allergies.
Family history was positive for a mother with neurofibromatosis and insulin-dependent diabetes mellitus. There was also a family history of asthma. The child lived with his parents and 1 sister. There were no smokers in the household, but there was an inside dog. They had central heat, and the boy’s immunizations were current.
Physical examination revealed a well-nourished, well-developed, lethargic, and ill-appearing boy who was uncooperative and somnolent during the initial examination. His temperature was 96.5°F (35.8°C), pulse rate was 129 beats per minute, blood pressure was 116/56 mm Hg, and respiratory rate was 28. His eyes had a disconjugate gaze, but the remainder of the HEENT examination was normal. Results of cardiovascular examination were normal, and his lungs were clear to auscultation with no wheezing noted. Although the neurologic examination was difficult to assess secondary to the child’s lethargy, he did move all extremities. His skin showed multiple café-au-lait areas and was extremely diaphoretic.
Initial laboratory evaluation revealed a white blood cell count of 16,200/mL (normal range, 3500–10,000/mL), plasma sodium level of 140 mmol/L (normal range, 135–145 mmol/L), plasma chloride level of 106 mmol/L (normal range, 98–107 mmol/L), plasma potassium level of 2.3 mmol/L (normal range, 3.5–5.0 mmol/L), plasma carbon dioxide level of 20 mmol/L (normal range, 22–28 mmol/L), normal serum urea nitrogen and creatinine levels, and a plasma glucose level of 31 mg/dL (normal range, 60–110 mg/dL). Owing to mental status concerns, a computed tomography scan of the head was performed with normal results. The child was admitted for further evaluation.
Following multiple injections of intravenous (i.v.) glucose during the first 3 hours after admission, the child’s blood sugar rose appropriately, only to fall again shortly after the physician left the room. The patient’s blood sugar level then normalized for the next 48 hours. On day 3, the child’s mother was informed that administration of i.v. glucose was being discontinued. That night, the child’s blood sugar level dropped into the high 40s despite repeated attempts to treat with i.v. solutions. Curiously, once the day shift started, the child’s blood sugar level again normalized.
Very early the next morning, the child’s blood sugar level once again dropped, this time into the 30s, with poor response to appropriate measures. Growth hormone, cortisol, insulin, C peptide, and lactate levels were measured. The child’s blood sugar level continued to fluctuate despite aggressive management. Of interest is that at one time during this episode, the i.v. tubing was noted to be leaking. Upon inspection, the tubing had a hole that looked like it was created by a needle.
Once the blood sugar level normalized again, dextrose was removed from the i.v. solution. Without the mother’s knowledge, however, the i.v. bag was intentionally mislabeled to suggest ongoing dextrose administration. The child’s subsequent blood sugar levels remained normal.
Suspicions that the mother was injecting some of her insulin into the child’s i.v. access were triggered by the fact that her son’s abnormally low blood sugar levels occurred only when she was in the room. The mother also voiced concern that her child was becoming a diabetic just like her, and the child knew how to perform his own finger prick for glucose monitoring. Behavioral aberrations on the part of the mother were also noted, as evidenced by her remaining curled up in a fetal position on the parent’s bed during her child’s most severe hypoglycemic episode.
On the fifth day of admission, the mother was removed from the room and the child’s blood sugar level subsequently remained normal. Laboratory results received that day from analysis of blood drawn on day 3 showed an insulin level of 9776 µU/mL (normal range, 5–25 µU/mL) and a C peptide level of 0.5 ng/mL (normal range, 0.8–4.0 ng/mL). The mother subsequently expressed concern about her child’s blood sugar level and confessed to covert administration of insulin. The child was removed from the mother’s custody and made a full recovery.
You get to the publisher site, but access to restricted resources is yet not possible.In that case, you see that the code “….ezproxy.kuleuven.be” is not included in the url. This means that the resource is not registered for off campus access. If you think this is in error, you can contact the e-resources department of the KU Leuven library to register this resource for off campus access.If off campus access to the resource is permitted according to the license agreement of the publisher, it will soon be activated by the technical services. You will be informed accordingly.You get the message: “You don’t have the rights to use the EZproxy of ..”
Only students and staff of an institution can have off campus access to the e-resources the institution pays for. This means that your student registration or contract only allows you to use EZproxy of the institution(s) you below to, and not to the EZproxy of other institutions within the KU Leuven Association.
Exceptionally, it can happen that you also see the above message when trying to use EZproxy of your own institution or organization. This could mean there is an administrative issue. Please contact the e-resources department of the KU Leuven library (email@example.com ) in that case. You can’t find the e-resource you want to consult via Limo:contact the e-resource service of the KU Leuven library(firstname.lastname@example.org).Off campus access to external sites that don’t belong to the library collection is not possible via EZproxy. Contact the ICTS department of the Leuven (email@example.com) if you have questions if this causes problems to you.
A proxy server is a computer (or service on a computer) that makes requests for a number of client computers on their behalf, typically to external resources. This article is concerned with HTTP proxy servers as HTTP is the protocol used to access the public APIs for Google’s web services. By extension, HTTPS or SSL proxies are also of interest when making HTTP requests that contain sensitive information such as private user data or passwords. Many large companies today use HTTP proxies to control what websites or information employees can view on the internet. Public libraries and schools have also been known to implement proxies for this purpose. There are also a number of publicly available proxy servers that can be used to anonymously access web content.
Potential issues faced when using a proxy server depend on what software is being used and how it is configured. A proxy is considered to be “transparent” if it does not alter the request from the client or the response from the server in any way other than is necessary for proxy identification and authentication. However, a large number of proxy servers do alter either the request or the response in ways that a developer should be aware of. In particular, certain proxies will alter the content-type of the response or strip out HTTP keep-alive headers from being sent to the outside server hosting the resource.
So why would a developer want to use an HTTP or SSL proxy? Generally, there are two reasons for this: it is required by some corporate infrastructure, or, the developer wishes to debug an application that uses a web service. The first reason is entirely unavoidable if the rules for the network the developer is working on prohibit non-proxied web or SSL connections to external websites. The latter reason is reported frequently in our support forums by developers trying to troubleshoot issues when dealing with a Google web service. There are special-purpose “debugging” proxies such as Fiddler and Charles that are geared towards this exact situation. For more information on this use of a proxy server, you may want to read our article On the Wire: Tools for API Developers.
For some applications, adding in proxy server support can be difficult. Fortunately, most of the client libraries for the Google Data API can be made to work with an HTTP proxy server after some slight code modifications. This article is intended to serve as a starting point for a developer who would like to use a proxy server for the web requests made by their application.
Using an HTTP proxy with the Java client library is easy thanks to Sun’s use of system properties to manage connection settings.
For example, if your corporate proxy server were running on “my.proxy.domain.com”, on port 3128, you could add the following to your code before creating a service object for Google Calendar, Google Spreadsheets, etc.
System.setProperty("http.proxyHost", "my.proxy.domain.com"); System.setProperty("http.proxyPort", "3128");
Alternatively, this can be done on the command line when starting your servlet environment:
java -Dhttp.proxyHost=my.proxy.domain.com -Dhttp.proxyPort=3128
With more recent versions of the JSSE package, this can be extended to SSL proxies as well. If the same proxy server in the previous example was running an SSL proxy on port 3129, the necessary code would be:
System.setProperty("https.proxyHost", "my.proxy.domain.com"); System.setProperty("https.proxyPort", "3129");
This can also be done from the command line in the same fashion as with the HTTP proxy.
Sometimes, you might need to provide credentials to a proxy server in order to use it. Usually, they are submitted using a base64 hash included in an HTTP header, as follows:
String encoded = new String(Base64.encodeBase64(new String("username:password").getBytes())); String base64encodedCredentials = "Basic " + encoded; myService.getRequestFactory().setPrivateHeader("Proxy-Authorization", base64encodedCredentials);
Note that the above code uses the Apache Commons Codec package in order to do the base64 encoding necessary. You’ll have to import the
org.apache.commons.codec.binary.Base64 class in order to run the above code.
To use an HTTP proxy with the .NET client library is not as trivial as with the Java client, but it can be accomplished in a similar way when creating the service object for a particular product.
For example, we might want to use a proxy to interact with the Google Calendar service:
using System.Net; CalendarService service = new CalendarService("CalendarSampleApp"); query.Uri = new Uri(calendarURI); GDataRequestFactory requestFactory = (GDataRequestFactory) service.RequestFactory; IWebProxy iProxy = WebRequest.DefaultWebProxy; WebProxy myProxy = new WebProxy(iProxy.GetProxy(query.Uri)); // potentially, setup credentials on the proxy here myProxy.Credentials = CredentialCache.DefaultCredentials; myProxy.UseDefaultCredentials = true; requestFactory.Proxy = myProxy;
This should detect the necessary proxy from your Internet connection settings–a nice feature of the .NET library. However, if you do not trust it to discover the proxy properly, you can also set it by changing the code to:
using System.Net; CalendarService service = new CalendarService("CalendarSampleApp"); GDataRequestFactory requestFactory = (GDataRequestFactory) service.RequestFactory; WebProxy myProxy = new WebProxy("http://my.proxy.example.com:3128/",true); // potentially, setup credentials on the proxy here myProxy.Credentials = CredentialCache.DefaultCredentials; myProxy.UseDefaultCredentials = true; requestFactory.Proxy = myProxy; Conclusion
This article has discussed how to have some of the Google Data API client libraries work with an HTTP proxy server. Developers working behind a proxy server mandated by network policy can still use these libraries. Developers can also employ a proxy server to help debug their code by having the proxy server record the contents of HTTP requests and responses being sent to and from a Google web service. There are more advanced use cases of a proxy server and other client libraries not covered by this tutorial. Developers needing additional help are encouraged to participate in our public support groups linked below.