roderick Posted March 14, 2012 Report Posted March 14, 2012 Hello, I'd appreciate any help with this:- I have a PC "A" on LAN1: this PC "A" has a static WAN IP and has utorrent running.- From a PC "B" I'm accesing a server which has PHP code that tries to do the following: http://[LAN1's PC "A" static WAN IP]:[PORT]/gui/?action=add-url&s=[TORRENT URL] The above action is executed unsuccessfully- Under the previously mentioned server, if I type the following in its browser navigation bar: http://[LAN1's PC "A" static WAN IP]:[PORT]/gui/?action=add-url&s=[TORRENT URL] The action is also unsuccessful (so I think that the server's PHP code is not necessarily wrong)- From a PC "C" on LAN1, if I type the following in its browser navigation bar: http://[LAN1's PC "A" static WAN IP]:[PORT]/gui/?action=add-url&s=[TORRENT URL] The above action is executed OKMy question is the following: is there a way I can execute the "add-url" action on a PC "A" from a server (or PC "B") that is on a different network without modifying the configuration of the PC-A's LAN router? Thanks in advance
DreadWingKnight Posted March 14, 2012 Report Posted March 14, 2012 if they're all on the same LAN, you do it with the LAN ip and not the WAN ip.
roderick Posted March 14, 2012 Author Report Posted March 14, 2012 Thanks for the response, but I think I have not explained the situation correctly nor accurately; I'll try to do it in the following lines:Situation A:- Under a server, we have PHP code that tries to do the following: http://[LAN1's PC "A" static WAN IP]:[PORT]/gui/?action=add-url&s=[TORRENT URL] The above action is executed unsuccessfullySituation B:- Under the previously mentioned server, if I type the following in its browser navigation bar: http://[LAN1's PC "A" static WAN IP]:[PORT]/gui/?action=add-url&s=[TORRENT URL] The action is unsuccessfulSituation C:- Under the previously mentioned server, if I type the following in its browser navigation bar: http://[LAN1's PC "A" static WAN IP]:[PORT]/gui The action is successful (which results weird to me, as situation B was not successful)Situation D:- From a PC "C" on LAN1 (192.168.1.101), if I type the following in its browser navigation bar: http://[LAN1's PC "A" LAN IP (192.168.1.199)]:[PORT]/gui/?action=add-url&s=[TORRENT URL] The above action is executed successfullySituation E:- From a PC "C" on LAN1 (192.168.1.101), if I type the following in its browser navigation bar: http://[LAN1's PC "A" LAN IP (192.168.1.199)]:[PORT]/gui The above action is executed successfully To sum up, I'd like to know whether there is any possibility that situations A and B could be executed successfully; also, the result of situation C seems strange to me.Thanks in advance.
klor Posted March 15, 2012 Report Posted March 15, 2012 Situation C won't require the token in the URL, but Situation B does.I would think if you try to access http://[LAN1's PC "A" static WAN IP]:[PORT]/gui from your PHP code you would succeed, as long as you authenticate the request correctly.The URL in Situation A needs the token inserted: http://[LAN1's PC "A" static WAN IP]:[PORT]/gui/?token=<token>&action=add-url&s=torrenturl.torrent&t=<timestamp>where <token> is retrieved with the XPath /html/div[@id=token]/text() from http://[LAN1's PC "A" static WAN IP]:[PORT]/token.htmland <timestamp> is the number of milliseconds since the Unix epoch. Note I don't actually know why the timestemp bit is needed, because I can't find it documented, but the WebUI does it.You'll also need to make sure you're sending the GUID cookie which you received when you first connected.
roderick Posted March 15, 2012 Author Report Posted March 15, 2012 Hello,your post has been very helpful.Thanks
Recommended Posts
Archived
This topic is now archived and is closed to further replies.