tags:

views:

958

answers:

4

I am writing an application using GWT on Windows that needs to do some network calls.

I know that if these aren't to the same machine I'm developing on I need to setup a proxy, right?

I was just wondering if anyone could help with what my GWT code would look like?

What proxy should I use on Windows?

Thanks!

A: 

If you mean Google Web Toolkit, and you're trying to evade cross-domain scripting restrictions, check out Yahoo's how-to guide. There's even PHP sample code.

Matthew Flaschen
That example actually involves writing your own PHP code as your own proxy.What I am looking to do is simply have my application connect through a proxy to wherever it needs to get data.
Hortitude
So you want to use an open proxy? That's not wise, as they come and go very frequently.
Matthew Flaschen
A: 

Why not perform the network calls in server side? That way you are not restricted to cross domain restrictions.

jassuncao
+2  A: 

If you're simply requesting data from a RESTful service from a different domain, you can use JSONP (http://code.google.com/webtoolkit/tutorials/1.6/Xsite.html).

If you're trying to post data, you'd have to perform the network calls on the server side. (There are some hackish ways to try to submit via a hidden iframe, but they're non-standard). What this means is that you simply invoke a method on your server which does the network call (see http://code.google.com/webtoolkit/tutorials/1.6/RPC.html).

Austin Tam
A: 

I think this is what you are looking for:

http://code.google.com/p/google-web-toolkit/issues/detail?id=3131

Gerardo Contijoch