is it possible to test APE v1.1.2 using telnet?

64 views
Skip to first unread message

Andy Ericksen

unread,
May 6, 2013, 9:27:18 AM5/6/13
to ape-p...@googlegroups.com
This works using APE v1.0.  

Using a browser to connect to APE on localhost (http://localhost:6969/?[{"cmd":"getHostname"}]) returns a valid result.

Connecting via telnet (telnet localhost 6969) and sending  'GET /' results in "Connection closed by foreign host.", but I expected a "No command given." html response.  

Sending 'GET /?[{"cmd":"getHostname"}]' also results in "Connection closed by foreign host.", where I expected a valid html/JSON response.

Sending the command via telnet works in APE v1.0, but not v1.1.2, is there a reason why telnet won't work anymore?

Thanks

Andy Ericksen

unread,
Jan 27, 2014, 2:34:45 PM1/27/14
to ape-p...@googlegroups.com
I normally wouldn't bump my own post, but nobody every responded.  I hope someone can answer this form me because I would like to upgrade but can't due to this limitation (bug?).

Louis Charette

unread,
Jan 27, 2014, 5:19:26 PM1/27/14
to ape-p...@googlegroups.com
Hi,

I believe you could make it work using the same technique I used to communicate with APE using Socket in iOS. To make it short, you use the same method as the transport protocol #1 in the Javascript client (don't remember the transport name), something like this :

GET /1/?[{"cmd":"CONNECT","chl":0,"params":{"name":"iOS514"}}] HTTP/1.1\n\nHost: 0\n\n


See this link for the socket based iOS client for reverence: https://github.com/lcharette/APE_iOS_Client


If you want to stay connected to APE to exchange messages with him in real time, you'll need to catch the "sessid" somehow and a patched version of the server available on my Github (https://github.com/lcharette/APE_Server/tree/fe98daf9db61410cb4358f248b74975cbd6072cb). To send and received one command at a time, it shouldn't be a problem.


  - Louis

Andy Ericksen

unread,
Oct 7, 2014, 4:52:45 PM10/7/14
to ape-p...@googlegroups.com
Updating in case anyone else runs into this 'issue', I was able to successfully test version 1.1.3-Dev as follows:

$telnet apeserver 6969

GET /0/?[{"cmd":"getHostname"}] HTTP/1.1 
Host: apeserver:6969



Note that I did not include the \n\n or \r\n and that I pasted two lines instead of including everything on one line.

I hope this helps someone.

Andy

Louis Charette

unread,
Oct 12, 2014, 3:47:35 PM10/12/14
to ape-p...@googlegroups.com
If you where to send the command as a string from a piece of code, "/n/n" would be required. But when using Telnet in the terminal or some socket app, an actual "new line" (i.e.: pressing enter) will be translated to "/n/n" on the server. It does ring some memories now...


  - Louis
Reply all
Reply to author
Forward
0 new messages