Nephilim
Nephilim

Reputation: 524

Cannot access WEBAPI(uTorrent) from another network,using the same code works for local networks

I have the port forwarded, I've checked here:

http://www.canyouseeme.org/

I can get the cookie, however using the this logic(that works for local networks):

The problem is that I cannot even get the token.

I get this error : FileNotFoundException

The same IP, port and link works fine in my browser, making me think there is either a problem with authentication or something with the cookie.

String authorization = "Basic " + new String(android.util.Base64.encode((auth).getBytes(), android.util.Base64.NO_WRAP));

That is then used like this:

connection.setRequestProperty("Authorization", authorization);

The HTTP response is : HEADER FIELDS{null=[HTTP/1.1 400 ERROR], Connection=[keep-alive], Content-Length=[17], Content-Type=[text/html], X-Android-Received-Millis=[1484153865632], X-Android-Response-Source=[NETWORK 400], X-Android-Selected-Protocol=[http/1.1], X-Android-Sent-Millis=[1484153865562]}

There shouldnt be an error at this point. I really dont get how it could be a bad request when connecting to a global IP but OK on a local connection.

So my question is. Should I authenticate differently when connecting to a global IP? How? Like always, the documentation is of no help at all.

Upvotes: 0

Views: 45

Answers (1)

Nephilim
Nephilim

Reputation: 524

No idea what was wrong. But setting up a new port at 8080, which could be used as an inside and outside port worked.

Upvotes: 0

Related Questions