GCM through Proxy

1,541 views
Skip to first unread message

Murugesan D

unread,
Aug 25, 2012, 6:25:19 AM8/25/12
to andro...@googlegroups.com
Hi All , 

I am trying to work GCM through proxy . I don't find any way to give my proxy details in the GCM server docs . 

I tried to set the System.setProperty as described in StackOverFlow .  But it is not working for me .

The only way i can able to work it by modifying the gcm-server .  [ Included proxy details in Post() method . ]

I am not sure about the license is allowed to modify the GCM server source and use it for commercial purpose .  

Please let me know is this possible ?

Waiting for the positive response .

Thanks
Murugesan D

Felipe Leme

unread,
Aug 28, 2012, 1:50:21 AM8/28/12
to andro...@googlegroups.com
Hi Murugesan,

The GCM library code is released under the Apache Software License 2.0, which allow you to modify it for commercial purpose.

Regarding the issue itself, if you think it would be useful to change the server to support proxies, please create a feature request on https://code.google.com/p/gcm/issues/list describing the use case scenario (and the proposed solution).

-- Felipe

Murugesan D

unread,
Aug 28, 2012, 6:01:18 AM8/28/12
to andro...@googlegroups.com
Hi Felipe , 

Thanks for the Update . 

Will create it as a feature request .

Regards , 
Murugesan

Alan W George

unread,
Nov 18, 2013, 5:03:16 PM11/18/13
to andro...@googlegroups.com

import com.google.android.gcm.server.Sender;

public class GCMProxySender extends Sender {

    @Override

    protected HttpURLConnection getConnection(String url) throws IOException {

        Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(this.getProxyHost(), this.getProxyPort()));

        HttpURLConnection conn = (HttpURLConnection) new URL(url).openConnection(proxy);

        return conn;

    }

Amarnath BS

unread,
Apr 30, 2015, 2:29:08 AM4/30/15
to andro...@googlegroups.com
further how to set proxy user name and password along with this ?
Reply all
Reply to author
Forward
0 new messages