WebSocket to Ldap

I am trying to etablish a websocket connection to an ldap server. That I can simply send binary data to and receive binary data. But it fails on the handshake whatever I do.

var socket = new WebSocket("ws://ads.de:PORT")

Yours sincerely Skeec

Answers


Web sockets is a specific protocol, like HTTP, and it has "nothing" to do with a TCP/UPD socket. You cannot connect with web-sockets to an LDAP-server, let alone connect to a different domain without receiving the appropriate CORS http-headers (and the browser supporting CORS).

You need to write a proxy WebSocket server application so that you can communicate with the LDAP-directory. You cannot do it in JavaScript (unless you want to use an ActiveX object, which will be incompatible with non-Microsoft browsers (and newer Microsoft browsers).

You better do it with plain-old AJAX with an asynchronous handler. You don't need WebSockets for that, you're only wasting bandwidth.


Need Your Help

Smarty is not choosing the correct templates to display

php smarty

I was working on a website yesterday and all was well. I was porting it to use Smarty. I had one last page to change which didn't require any testing since the Smarty template file didn't really do...

problem in mysql queries in using union

php mysql

i was looking for a way to combine different mysql queries in a php file so this is my code :