grimstoner Posted March 14, 2011 Report Share Posted March 14, 2011 HiI'm trying to do a Silverlight interface for uTorrent, which requires the base address to return either a crossdomain.xml or clientaccesspolicy.xml (i.e. http://my.utorrentserver.com:myport/clientaccesspolicy.xml).I've tried adding a clientaccesspolicy.xml file to the WebUI zip file, but when I try to request the above Uri, I get a "invalid request".Is there any way to return a clientaccesspolicy.xml/crossdomain.xml file?Reference : http://msdn.microsoft.com/en-us/library/cc197955(VS.95).aspxhttp://www.adobe.com/devnet/articles/crossdomain_policy_file_spec.html Link to comment Share on other sites More sharing options...
DreadWingKnight Posted March 14, 2011 Report Share Posted March 14, 2011 it's in /gui/not in / Link to comment Share on other sites More sharing options...
grimstoner Posted March 14, 2011 Author Report Share Posted March 14, 2011 Silverlight makes the request to the base address...i.e. http://my.utorrentserver.com:12345/clientaccesspolicy.xmlnot http://my.utorrentserver.com:12345/gui/clientaccesspolicy.xmlI'd like to serve the clientaccesspolicy.xml from the root. Did a quick search on requesting it from a subfolder, but couldn't find any. Link to comment Share on other sites More sharing options...
grimstoner Posted March 14, 2011 Author Report Share Posted March 14, 2011 Indeed... requesting the policy files from a subfolder is not possible :http://forums.silverlight.net/forums/p/33421/102714.aspx Link to comment Share on other sites More sharing options...
grimstoner Posted March 14, 2011 Author Report Share Posted March 14, 2011 In main.js, there's a function that builds a token response in response to the request http://my.utorrentserver.com:12345/token.html called (lo and behold) requestToken. I can write another function to return the contents of my clientaccesspolicy, i.e. something like this (I'm not a Java dev, so regard it as pseudocode) :requestPolicy: function (c, { var a = this; try { new Request( { url: urlBase + "clientaccesspolicy.xml?t=" + $time(), method: "get", async: !! b, onFailure: (c) ? c.bind(a) : $empty, onSuccess: function (e) { a = "<?xml version="1.0" encoding="utf-8"?><access-policy><cross-domain-access><policy><allow-from> <domain uri="*"/></allow-from><grant-to><resource path="/api" include-subpaths="false"/></grant-to></policy></cross-domain-access></access-policy>"; if (c) { c.delay(0) } } }).send() } catch (d) { } }but, how do I get the app to call the function whenever a request is made to http://my.utorrentserver.com:12345/clientaccesspolicy.xml? Link to comment Share on other sites More sharing options...
DreadWingKnight Posted March 14, 2011 Report Share Posted March 14, 2011 All uTorrent webui api calls and functionality are handled through the /gui/ address set, not through the root address set.Not much can be done if you can't handle things in a subfolder. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.