Application proxy not set?

3778
8
07-09-2016 09:56 PM
JimColl
New Contributor II

I have finally managed to splice together the directions and closestFacility tasks, but I now get a new proxy error, and I can't trace down what is causing it.  I am able to get both the directions and closestFacility examples to work on the site using the same url's, but for some reason when they come together they throw the error: "esri.config.defaults.io.proxyUrl is not set. If making a request to a CORS enabled server, please push the domain into esri.config.defaults.io.corsEnabledServers".  You can see this in action at the site below, and if you f12 in chrome you can see the error.  Has anyone else encountered this or have an idea as to how I might solve this?  Any help would be greatly appreciated.

Flood HIPPO

0 Kudos
8 Replies
ChrisSmith7
Frequent Contributor

Jim,

I don't use GitHub for source control/project hosting, but I am pretty sure you can't host server-side apps there. When I try to hit your proxy directly, it simply serves-up the .php file as a download.

ChrisSmith7
Frequent Contributor

Just to follow-up, are you simply testing for yourself, or does this need to be live? If the former, I would just set-up a localhost instance of your project. If it needs to be live, you'll need to make it forward-facing yourself, or you can look into using something like Amazon.

JimColl
New Contributor II

I am attempting to make it live, let me make sure that I am attempting to do something I actually want to do first.  I can get the code to work correctly with smaller requests (see Flood HIPPO ).  The reason I've switched to the proxy is that the new code (Flood HIPPO ) makes a request too large, and it looks like the proxy is necessary.  Am I interpreting this correctly?

Thanks for your help, it is greatly appreciated!

0 Kudos
ChrisSmith7
Frequent Contributor

That's correct - among other things, the proxy will enable your app to process large requests of data. It will also allow behind-the-scenes authentication against secured services, throttle excessive requests, whitelist referrers, and allow cross-domain resource consumption when CORS is not available.

The thing is, since this is a server-side handler (I use the DotNet proxy and its .ashx extension), which GitHub doesn't support as best I can tell, you'll need to host it "for real."

RebeccaStrauch__GISP
MVP Emeritus

as Chris mentioned, you have to host your web page "for real" thru some means like microsoft IIS, or similar hosting environment,  you will want to down load the resource proxy and have it on the same machine, in the wwwroot folder (for IIS ) and per the instructions, you would use one of the three options.  I also use the dotnet version, but actually use a folder that is not the default name.

if you only need the proxy for large responses, or for printing, you may not need to modify the config.xml at all. However, if you are accessing any secure services, you may need to supply the proper URL and token, or URL and username/password.  If doing the later, I highly recommend you web site use https, and that you specify the machines that will have the web pages that will call the proxy.  This will limit/prevent unauthorized access to your services (if using ArcGIS Server, or premium ArcGIS Online services maybe too).

The readme file for the resource proxy explains how to test the proxy against a service.  But you will need to call/add reference pointing to the proxy in you Javascript or other web page.

with that said, I have no experience trying to host a web page on a location that you are providing  ...GitHub.io  Trying that site, I just get a "location not provided" on the safari browser (iPad)

edit: park way down i have some links re proxies on the Web AppBuilder Developer Edition - Customization Resource List   might have something useful in one of those threads.

JimColl
New Contributor II

Thanks for all of your help so far, this was a far more painful process than I was hoping for but this community has been incredibly helpful.  I think I have this one last hurdle.  The site now runs (Flood HIPPO ), and executes successfully, but requires a log in, which I was hoping to avoid.  My current proxy config looks like so (mikecp11.github.io/proxy.config at master · mikecp11/mikecp11.github.io · GitHub ) .  Do you have any idea what I have misconfigured?

0 Kudos
RebeccaStrauch__GISP
MVP Emeritus

I'm still gettin an error on your website, but may be an iOS issue (iPad)

image.jpeg

Are you running thru the tutorial (I'm guessing yes, since it looks familiar) and following each step?  Did it work when doing the simple test?  I know I had issues with the dotnet version whe using referers, but you have that part open.  I don't know anything about the pop version, but does it make sense to have the client/hint AND the auth2? Seems to me it would need one or he other.  when I tested it in the tutorial, the client/secret was all I needed for the AGOL provided utilities (route/traffic). Try taking the auth2endpoint line out.

0 Kudos
JimColl
New Contributor II

(I believe it is an IOS issue as I can get it to load in both firefox and android, thanks for the heads up!)

I am, and was able to get the simple tests to work.  It's the transition into the proxy that has me stumped, and I've attempted many of the variants including providing username and password.  I'll attempt the dotnet version and see if that makes any difference.

0 Kudos