Introducing the Harbour websocket server

mod_harbour is an Apache module that allows to run PRGs directly on the web !!!

Introducing the Harbour websocket server

Postby Antonio Linares » Sat Apr 18, 2020 8:53 am

Here you have a first prototype of a Harbour websocket server:

https://github.com/FiveTechSoft/wsserver

Basically this server allows you to communicate between a web browser and a Harbour app (no matter where it is!), using websockets.

In this version the websocket server implements an echo service, just to check that it properly works. It sends you back whatever you may send to it. You can easily change its source code to implement any other conversation you may have in mind. It uses the port 9000 but you may use any other, just remember to change it in both wsserver.prg and in client.html

How to test it:

1. Build wsserver.exe using hbmk2 wsserver.prg -mt. Use the hbmk2 flag -mt to build it multithreading!

2. Run wsserver.exe. It will display all messages that arrive to it. "loop" is shown on the screen. Press esc any time to end it.

3. Open this HTML page from your browser:

https://fivetechsoft.github.io//wsserver/client.html

4. Whatever you send to the server from the web page, it will get back to you (sort of a karma reminder :-)

5. Write exit to tell the server to end your session.

Enjoy it!
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Introducing the Harbour websocket server

Postby Massimo Linossi » Sun Apr 19, 2020 8:52 am

Hi Antonio.
This is really great.
Many, many compliments.
User avatar
Massimo Linossi
 
Posts: 498
Joined: Mon Oct 17, 2005 10:38 am
Location: Italy

Re: Introducing the Harbour websocket server

Postby acuellar » Thu Apr 23, 2020 8:59 pm

Muchas gracias Antonio

Muy bueno.
Saludos,

Adhemar C.
User avatar
acuellar
 
Posts: 1643
Joined: Tue Oct 28, 2008 6:26 pm
Location: Santa Cruz-Bolivia


Return to mod_harbour

Who is online

Users browsing this forum: No registered users and 4 guests