How to connect to a port from javascript in firefox extensions? I could able to open the port and listen (Server side socket), but I want the Client side socket which will connect to server (Port opened in java).
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You use nsISocketTransportService.createTransport(). Something like this should work:
All connection events happen asynchronously so in order to listen to transport events you need to call
transport.setEventSink():For reference: nsITransportEventSink, nsITransportEventSink status codes