Showing posts with label html5. Show all posts
Showing posts with label html5. Show all posts

Thursday, March 24, 2016

Google's hterm: HTML5 terminal emulator

Google's hterm is a nice terminal emulator. I would like to use the hterm part only and do some remote telnet session test (I used libtelnet for the back-end server). But I encountered some usage problems.

First, you could not build a functional hterm script with the github repository, you will need to checkout the full repository from https://chromium.googlesource.com/apps/libapps/ and build from there.

Second, the embedded document is lagging. After following the description in the document, the terminal could be displayed without problem, but there is no input at all. The call back function register to the io.onVTKeystroke() never get called. After digging through other part of the libapps repository for hterm's usage, I found term.installKeyboard() function of the hterm terminal instance need to be called after the term.decorate() call. After that input event could be received.

Third, I haven't found a way to make it acknowledge IME input. Cut and paste utf8 encoded characters causing it to output escaped utf8 stream (utf8 encoded of an utf8 stream).

Wednesday, July 29, 2015

Setup guacamole server on Slackware

I encountered the need to access some ssh/telnet/vns server through a client-less HTML5 web app.

Gooling gave me the best product and it is free, the guacamole server.  Looking at the building requirement of it at, I found Slackware by default does not come with all the components needed.  Follow the build procedure in the document, I started with building guacamole-server.

Building guacamole-server

I tried to build all the dependency in except for PulseAudio.  After look through the supported list of needed libraries, FreeRDP, libssh2, have build script at SlackBuilds.org, and libtelnet does not.  After installed FreeRDP and libssh2, I wrote build script for libtelnet, it built and installed without problem.

After I had all the libraries installed, I downloaded the server code guacamole-server-0.9.7.tar.gz.  The package does not come with a ready to use configure command, and have to use autoreconf -fi to bootstrap it.  The configure failed for not finding OSSP UUID library.  Slackware already comes with a uuid library from the util-linux package and it is better than the OSSP one.  So I developed a patched to use the uuid library from util-linux and it works without problem.

Building guacamole-client

The guacamole-client needs to be run under a Java Servlet server.  Luckily, SlackBuilds.org has all I need.  After installed the latest jdk, apache-ant, commons-daemon, apache-tomcat with sbopkg, I had a tomcat server up and running.  I still need to configured /etc/tomcat/tomcat-users.xml to allow to to use the manager GUI. I added the following line to it (of course the user name and password are not the real one I am using ^_^):
<user password="manager" roles="manager-gui" username="manager">
</user>
Guacamole-client needs Apache Maven to build, and SlackBuilds.org has a script for maven.  After installed maven, and with the command mvn package guacamole-client was built and a war file was created in guacamole/target/guacamole-0.9.7.war.  I made it install to /usr/share/lib/guacamole/guacamole-0.9.7.war and had it symbolic links to /var/lib/tomcat/webapps/guacamole.war.  Now I could saw it from Tomcat's manger GUI, accessing it with url http://localhost:8080/guacamole I got a blank screen :(, that was not good.  I have the impression that it should be very easy to setup, now it failed on me.  After reading the documentation again, and again, I realized I failed to setup a user-mapping.xml in /etc/guacamole/.  After follow the example, voila! it showed me the login page, after logged in, I was presented with the entries I had setup earlier in user-mapping.xml.  Links with remote servers are working great!

I am preparing SlackBuilds.org scipts to submit, should not wait too long for them to show up.