6

Is it possible to connect openVPN programmatically from the Chrome extension API? All I've found in Chrome extensions API docs are chrome.proxy and chrome.socket.

I belive it is possible to run external program using NPAPI and this extenral program will create nessesary openVPN connection.

UPD: It seems that OpenVPN have TCP/Socket management interface ( see http://openvpn.net/index.php/open-source/documentation/miscellaneous/79-management-interface.html ) So it is rather easy to connect it from Chrome extension programmatically.

Kirzilla
  • 16,368
  • 26
  • 84
  • 129
  • 1
    NPAPI could do it, but chrome has [announced](http://blog.chromium.org/2013/09/saying-goodbye-to-our-old-friend-npapi.html) they are going to kill NPAPI support sometime in 2014. At this point, the only thing that can run an external program on Chrome is a protocol handler. – vcsjones Jan 16 '14 at 22:59
  • my guess is several "high profile" NPAPI plugins will get whitelisted, like Java and Silverlight. – vcsjones Jan 16 '14 at 23:20

1 Answers1

3

@vcsjones is correct... the proper way would be with NPAPI or a protocol handler. However, there is another method.

In the past, when I have needed to execute native code with a browser extension, I embed a small HTTP server into a native application that can be called from the browser extension. This allows me to write whatever I need to, while the browser extension is nothing but a control for that native application. You could then easily write something to control OpenVPN.

Brad
  • 159,648
  • 54
  • 349
  • 530
  • 1
    Aha, got it. So I can write simple python application that will listen on port and will connect any OpenVPN configuration I need on request. Very nice idea, thank you! – Kirzilla Jan 16 '14 at 23:09
  • Hey, Brad. Seems OpenVPN have management interface; see UPD for my original question. – Kirzilla Jan 16 '14 at 23:22
  • 2
    @Kirzilla You still need a go-between. You won't be able to open a raw TCP socket from a browser extension. – Brad Jan 17 '14 at 03:18