1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-08 20:50:28 +00:00
Files
browser/src/proxy/native-messaging-proxy.ts
2020-11-30 15:10:57 +01:00

24 lines
648 B
TypeScript

import NativeMessage from './nativemessage';
import IPC from './ipc';
// Proxy is a lightweight application which provides bi-directional communication
// between the browser extension and a running desktop application.
//
// Browser extension <-[native messaging]-> proxy <-[ipc]-> desktop
export class NativeMessagingProxy {
private ipc: IPC;
private nativeMessage: NativeMessage;
constructor() {
this.ipc = new IPC();
this.nativeMessage = new NativeMessage(this.ipc);
}
run() {
this.ipc.connect();
this.nativeMessage.listen();
this.ipc.onMessage = this.nativeMessage.send;
}
}