Reputation: 157
I'm looking to perform a simple FTP RETR of an image at a known server location from within a Google Chrome Packaged App. I'm exploring the following avenues:
XMLHttpRequest (which throws Exception 101: cross domain only allowed for HTTP)
TCP chrome.socket.write (sends packets OK, but no way to receive TCP data? Edit: wrong)
WebSockets (which throws Exception 18: WebSocket port 21 blocked)
<webview>
(pulls the data alright in a sandboxed process, with no way to intercept it)
I've tried considering other possible approaches (my device runs a telnet server on port 23) but I don't think there are any shortcuts here.
Could my Chrome App possibly capture the webview's pixeldata in an HTML5 Canvas?
Have I overlooked any other communications mechanisms? All guidance appreciated.
Edit: apsillers/sowbug's comment per chrome.socket.read
has reopened avenue #2. Woops! Using this on the port per the PASV response allowed me to perform a stream and retrieve the image data - thanks.
If it helps anyone else, here's the beginnings of a socket object and ftp client which run in an extension/app.
Usage: new Ftp('192.168.1.1', 21).retrieve('/path/to/file.ext', eofHandler);
Upvotes: 1
Views: 619