Hello!
Is there a way to create a socket connection from within a web page using javascript?
The scenario is this: I want a webpage to establish a connection with a server, receive data and write the received data to a specific place in the web page's DOM tree as it arrives. (No, I cannot have Mozilla load a url in a specific frame or something similar, I need to handle the data myself.)
Regards, Felix
you can use mozilla's scriptable socket APIs (see nsISocketTransportService) provided your JavaScript has appropriate permissions. that usually requires a preference on the browser or a popup alerting the user to the fact that JavaScript on the current page needs to access privileged interfaces. what you're trying to do is usually accomplished using "signed scripts", but there are caveats you need to be aware of. i don't have all the details here, so you should try to ask about this on n.p.m.security or maybe n.p.m.dom.
darin
