Web site from CHUI interface

Posted by scott_auge on 06-Apr-2018 16:14

Any ideas on how to access a web site on a browser from a CHUI interface?

Other than the obvious "magic key" and showing an URL to cut and paste from?

All Replies

Posted by ChUIMonster on 06-Apr-2018 17:44

If "access" means "obtain data from" then you would basically write some socket code to make http requests.  Or shell out and run curl.  And then parse the result.

I'm  guessing you already know how to do that so perhaps you are more interested in some sort of coordination between a character window open in a terminal emulator and a browser that is maybe also running on that same desktop?

Some emulators let you do things by sending magic text to a defined area on the screen.  (Refections has this capability.)  You can sometimes make it pretty seamless to the user by doing things like writing "white on white"  (or whatever).

The Chrome browser has an SSH extension that does a nice terminal emulation and which supports some features that let you do things like control-click on a link to open it.  https://goo.gl/muppJj

If you have complete control over everything you could also probably write some little "glue" component that sits on the PC, listens for requests on a known port and makes stuff happen in the browser.  The ChUI session should be able to figure out what IP address it came from either directly if it is a -H & -S connection or via some shell scripting with "who" on the host side.  But that all sounds like a lot of work to me. It might be better to fork PuTTY and create what you need more directly.

Posted by Peter Judge on 08-Apr-2018 15:46

If "access" means "obtain data from" then you would basically write some socket code to make http requests.  Or shell out and run curl.  And then parse the result.

 
Or (to save you some effort) use the HTTP client that’s been in the OE box since 11.5.1  (which is a socket implementation).
 

This thread is closed