title: Google cloud messaging GCM through proxy
body: <p>I am having trouble sending a message to a device through the company proxy.<br>
  I have done the GCM tutorial on the google site and have successfully registered a device on the google servers with the android emulator,
  and also on the server at my end.<br>
  For this I had to go through the company proxy, setting it in the access point of the emulator.
  Now the problem I have is sending a message from my server to the device through the same proxy.
  I am using the servlet code from the demo which uses the    </p>
  
  <pre><code>com.google.android.gcm.server.Sender
  </code></pre>
  
  <p>helper class to send the message.  </p>
  
  <p>I am running the servlets on tomcat 7.</p>
  
  <p>I have tried setting the proxy up in the catalina.properties file like so. </p>
  
  <pre><code>http.proxyHost=proxy.company.com  
  http.proxyPort=8080
  </code></pre>
  
  <p>And I have tried setting properties inside the servlet itself like below.  </p>
  
  <pre><code>System.setProperty("http.proxyHost", "proxy.company.com");  
  System.setProperty("http.proxyPort", "8080"); 
  </code></pre>
  
  <p>But still I get the timeout.
  I know its the company proxy because I got the messaging working at home where I have no proxy.</p>
  
  <p>I have seen a proxy object created in the java code and then a connection created with it, but I dont think that is usable here since I am using Sender helper class to send the message. </p>
  
  <p>This is the line that fails in a timeout.</p>
  
  <pre><code>Result result = sender.send(message, registrationId, 5);
  </code></pre>
  
  <p>Any help would be appreciated.</p>
  
  <p>Regards</p>
  
  <p>Bill</p>