pas2js/demo/websockets
2021-09-01 11:36:43 +02:00
..
demowebsocket.lpi * Add websocket example 2021-09-01 11:36:43 +02:00
demowebsocket.lpr * Add websocket example 2021-09-01 11:36:43 +02:00
guest.png * Add websocket example 2021-09-01 11:36:43 +02:00
index.html * Add websocket example 2021-09-01 11:36:43 +02:00
README.md * Add websocket example 2021-09-01 11:36:43 +02:00
serverconfig.js * Add websocket example 2021-09-01 11:36:43 +02:00
style.css * Add websocket example 2021-09-01 11:36:43 +02:00
you.png * Add websocket example 2021-09-01 11:36:43 +02:00

Websocket demo

This demo is intended to run with the wsserver demo of the FPC websocket support example wsserver. It is a small chat server client.

Running the example

To run it, run the FPC wsserver example application (see fcl-web/examples/websocket/server).

wsserver -p 8080

Edit the serverconfig.js and set the correct server URL:

var 
  serverConfig = {
    "url": "ws://localhost:8080/"
  };

(change port etc. to match your setup)

Compile the demowebsocket example using lazarus or pa2js.

run simpleserver (or any other webserver) in this directory:

simpleserver -p 3000

and point your browser at port 3000:

http://localhost:3000/