Kerry Buckley

What’s the simplest thing that could possibly go wrong?

Bookmarklet to convert intranet URIs for connection via VPN

leave a comment

It’s quite common these days for organisations to allow external access to their intranets using an SSL VPN, but it can be a bit of a pain if you’re trying to follow a ‘normal’ intranet hyperlink (eg from an e-mail) – you have to paste the URL into a box on the VPN homepage and have it converted.

To make it easier I’ve created a bookmarklet to do the conversion. It may not work for all sites, as I’m only constructing the new URI based on a simple inspection of a couple of pages.

To use this technique, assuming you have the same gateway software as us (I don’t know what it is, but I’m guessing it hails from Redmond) simply create a bookmark called something like ‘connect via VPN’ to the following address, substituting the appropriate value for vpn.acme.com:

javascript:window.location.replace('https://vpn.acme.com' + window.location.pathname + (window.location.port == '' ? '' : ':' + window.location.port) + ',DanaInfo=' + window.location.host + (window.location.search == '' ? '' : '+' + window.location.search))

You can then follow a link to an intranet site, which obviously won’t load, then just select the new bookmark and you should be taken to the page using the VPN (after logging in, if you don’t have an active session). It works for me in Firefox, but unfortunately not in Safari, which doesn’t seem to return the expected window.location for pages which it can’t load.

Written by Kerry

January 6th, 2007 at 3:29 pm

Posted in BT,Software

Leave a Reply

You must be logged in to post a comment.