Jump to content

help with api


jonniebigodes

Recommended Posts

hi.

i've been developing a solution using flex to work with the web api.

this because i'm trying to understand the works of remoting with flex and the webapi.

i've been having some issues with getting the list of torrents from utorrent.

while trying to get the list of torrents i'm getting this:

Warning: Ignoring <site-control> tag in policy file from http://mycomputer/WHSUTC/crossdomain.xml. This tag is only allowed in master policy files.

Warning: Ignoring 'secure' attribute in policy file from http://mycomputer/crossdomain.xml. The 'secure' attribute is only permitted in HTTPS and socket policy files. See http://www.adobe.com/go/strict_policy_files for details.

Warning: Failed to load policy file from http://mycomputer:port/crossdomain.xml

*** Security Sandbox Violation ***

Connection to http:/mycomputer:port/gui/?list=1 halted - not permitted from http://mycomputer/WHSUTC/WHSUTC-debug/WHSUTC.swf

and in that folder and in the root of the webserver i've got a crossdomain file with the following:

<?xml version="1.0"?>

<cross-domain-policy>

<site-control permitted-cross-domain-policies="all"/>

<allow-access-from domain="*" to-ports="*"/>

</cross-domain-policy>

any ideas on how to solve this?

help would be appreciated

thanks in advance

Link to comment
Share on other sites

  • 3 weeks later...

can anyone give any pointers on how to solve this?

i've got a crossdomain file inside the webui.zip,

the content of the file is this


<?xml version="1.0" encoding="utf-8" ?>
<cross-domain-policy>
<allow-access-from domain="*"/>
</cross-domain-policy>

i'm still getting the following error:

Error: [strict] Ignoring policy file at http://myhost:port/crossdomain.xml due to incorrect syntax.  See http://www.adobe.com/go/strict_policy_files to fix this problem.

*** Security Sandbox Violation ***
Connection to http://myhost:port/gui/?list=1 halted - not permitted from http://anotherhost/folder/folder/whatever.swf

anyone?

Link to comment
Share on other sites

First step is to authenticate. This involves supplying the admin username and password and receiving back a cookie and a token (if token_auth is set which it should be).

Then you probably already know how to get the list of torrents and parse it? You will need to send back the cookie and include the token in all requests including this one. I don't know about flex but many tools will automatically receive and send back the cookie but you'll have to parse out the token yourself and explicitly include it in each request.

Using one or more torrent hashes, you can then send the other commands, again including the cookie and token with each one.

Link to comment
Share on other sites

that's what i'm doing basically....

i'm trying to load the http://myhost:port/gui/token.html to get the token.

this done with my username and password encoded using a base64 encoder in the header of the request.

i've tried using a httpservice, a urlloader but still i'm getting the same error.

and it's driving me crazy.

i've been testing a few things, and i saw that in air works like a charm, but using the standard web approach it only works locally.

but if i test it on a webserver it breaks on the spot

Link to comment
Share on other sites

I'm not familiar with the software package you're using. I've done this in Firefox using XmlHttpRequest and I've done it in Curl on Linux.

I guess XmlHttpRequest might be closest so I'll try to describe it. The token request is a GET to the URL you mention. You have to make sure to send it to the right port, 8080 by default. The username and password can be included in the GET, or I can let Firefox prompt for them. You might want to test this on the command line first to see if you have everything configured right and get a response back.

The token response is just a string. It is an HTML div containing the token. I parse it by forcing the response to XML (think it is text/html in the header?) and extracting the first node from the div, because that's the sort of thing Firefox is good at. In Curl I used sed to just cut out the token.

Sounds like you might be having problems with actual connectivity. Have you tested this with a local uTorrent? That would be easiest. Once you get that working then you can be more confident about connecting to a remote server. You'll need to have your router open the right ports, because I don't think 8080 will be open in most cases. You might have to configure uTorrent and your software to use a different port/

Sorry I don't have a better idea what tools are available to you. Python? Curl? Everyone has a browser and I'm sure you could do what you need as Firefox extension.

Link to comment
Share on other sites

in a nutshell, i'm trying to create a midlle point between me and utorrent.

i was planning to deploy this pet project on a apache webserver, and instead of using the actual webui to interact with utorrent, i wanted to use this.

also the development of the pet project was in order to understand more on the communication framework of flex and utorrent's webui.

what you've explained is my general understanding of how to get the token and authenticate with webui and also with webui, i've checked my router and the necessary ports are open.

using air, and setting server to none in flex it will work both locally and remotely, as soon as i put the release of the project in the server, it breaks, getting the sandbox violation.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...