Nathan
Nathan

Reputation: 96

Firefox Extension Port Listener

Hey, I'm trying to get an extension to wait for a xml message from another program over an internal port. Just something like waiting for a single UTF-8 string that has something like:

<?xml version="1.0"?>
<status received="true" state="started"></status>

and

<?xml version="1.0"?>
<status received="true" conn="closed"></status>

I want to reliably report communication between the two, along with some nice little error messages.

The program that I'm sending xml messages to is a completely standalone Java application that runs on the user's machine, the extension is allowing the user to open files using that application through the browser. The application sends several xml messages out on the port its using(and thus the port the extension is using) when it receives incoming connections and sends out xml status updates.

Upvotes: 1

Views: 1164

Answers (3)

CAFxX
CAFxX

Reputation: 30281

If you just need to read/write files from the user computer, why don't you simply use the APIs provided by Mozilla instead of using a java program to do the exact same thing?

Upvotes: 0

phoenix24
phoenix24

Reputation: 2102

Why not make use of websockets or ajax calls, particularly if it a webserver behind the internal port you are trying to connect / listen ?

Upvotes: 1

Nathan
Nathan

Reputation: 96

I just found nsIServerSocket and I think this is what I want. I'm going to try it out and report back, but if anyone knows of a more appropriate Mozilla service to use please tell!

Upvotes: 2

Related Questions