In case you need your browser to handle URIs not http or https , you will need somehow to instruct it, that it has open telnet , ssh or whatever other application.

In my case this happened to me while using Firefox and trying to open a network device console running on EVE-NG. Despite the fact there is both Windows and Linux clients integration packages -you can browse EVE-NG downloads to get them. I wanted to script this manually and be 100% sure I know what happens under the hood.

So here we are, as an example let’s go for the telnet handler. When we open a console to a device within EVE-NG, it will trigger the browser to open, ie, telnet://eve-ng.host:32771.

Now depending on the browser we use, it may ask us how do we want to open the link, if we want to switch applications or something similar. In our case we will write a ZSH script that will do the trick.

Get our favourite Linux text editor and create a script file. I’ll go for firefox-telnet-handler.zsh. And put the following content on it:

!/bin/zsh  
 url=$1  
 proto=${url//: _/} data=${${url//_ :\/\//}%/}  
 data=${data//\%20/ }  
 data=${data//\$HOME/$HOME}  
 address=${data//[:]/ }  
 /usr/bin/gnome-terminal -e "$proto $address"

Save it, and in case you don’t know how, give it execution permissions, like so:

chmod +x firefox-telnet-handler.zsh

That’s it. Now you only need to tell your browser to run the script upon clicking on the telnet URIs.

It will trigger a new terminal window that will open the telnet connection to the machine provided in the link and over the specified port also in the link.