Connect OpenVPN in Chrome extension?
Asked Answered
I

1

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.

Iritis answered 16/1, 2014 at 22:56 Comment(2)
NPAPI could do it, but chrome has announced 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.Antagonistic
my guess is several "high profile" NPAPI plugins will get whitelisted, like Java and Silverlight.Antagonistic
S
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.

Salicaceous answered 16/1, 2014 at 23:2 Comment(3)
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!Iritis
Hey, Brad. Seems OpenVPN have management interface; see UPD for my original question.Iritis
@Iritis You still need a go-between. You won't be able to open a raw TCP socket from a browser extension.Salicaceous

© 2022 - 2024 — McMap. All rights reserved.