简体   繁体   中英

Using SSH in Google Chrome Extension

I want to write an Extension for the google chrome browser which reads some links from a website and copy these links into a file. I want to send this file via ssh to another computer in my local network.

How can I setup and use a ssh connection in my chrome extension?

Assuming you mean scp, not ssh, here are your options:

  • Set up a WebSocket proxy. Write JavaScript to send the XHR-fetched ArrayBuffer. WebSockets can go over SSL, so you'll probably be satisfied with that rather than implementing SSH in JavaScript (and then scp over that).
  • Same idea but an HTTP proxy. This would be pretty painful. See Web-based SSH for overview.
  • Write a Chrome App, thereby getting access to chrome.sockets . Implement SSH in JavaScript. See paramikojs to get started.
  • Chrome App, Native Client. This can actually work; see Secure Shell. Add scp functionality.

The Chrome-App-based solutions raise a separate question of how to get the web content. You might be able to use Chrome Apps webview. Or you can message the content between the app and a Chrome Extension.

There are probably other approaches as well. But you get the idea: you have a lot of coding ahead of you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM