Yes it is!rathinagiri wrote:Very good Roberto. It is pretty fast enough.
There is a lot of work pending on table to (ie) make rows selectable, make the headers fixed, etc., but the important thing is that was probed that the project is possible.
Moderator: Rathinagiri
Yes it is!rathinagiri wrote:Very good Roberto. It is pretty fast enough.
You must edit server name in the line #25 of demo.server.html, changing localhost by the ip address of the server.rathinagiri wrote:Again a basic doubt.
How can we reach the demo.server.html file from another system (say another machine in the same LAN)?
Please, consider that to serve web pages, you'll additionally need an http server.rathinagiri wrote:Ok. I will check and tell.
I'm using a nice pre-configured bundle (Apache,PHP and MySql) called 'vertrigo'.rathinagiri wrote:Yes. I have Apache.
1. There is no a mechanism for that right now, but could be extremely easy to do. Please take a look at the code and you'll figure out.apais wrote:In harbour tree there is an http server called uhttp ( micro http )
Now my question:
1) How can we filter the list of callable routines in the ws-server ?
I don't want someone calling quit() or ferase(*.*) from a web page
2) how can we identify sessions of validated users ?
Regards
Angel
This is the 'listen' method of HBSOCKET class.Roberto Lopez wrote:
1. There is no a mechanism for that right now, but could be extremely easy to do. Please take a look at the code and you'll figure out.
2. You could ask for a password at user login. Please consider that the session does not exist in the same sense that a session is when http is used. With websockets, once that you connected to the server, you'll stay connected.
I've not analyzed the code deeply, but as I've understood with a brief look, it is multi-threaded, so, you should not care about multiple users.
The server is Harbour, so, you can modify as you want.
Again... the code must be analyzed in detail to be sure how it works, so, some of my preliminary conclusions could be wrong.
Code: Select all
METHOD Listen() CLASS HBSocket
::pSocket = HB_SocketOpen( )
::hMutexUser = HB_MutexCreate()
IF ! HB_SocketBind( ::pSocket, { HB_SOCKET_AF_INET, ::cBindAddress, ::nPort } )
QOut( ::cError := "Bind error " + hb_ntos( HB_SocketGetError() ) )
HB_SocketClose( ::pSocket )
RETURN .F.
ENDIF
IF ! HB_SocketListen( ::pSocket )
QOut( ::cError := "Listen error " + hb_ntos( HB_SocketGetError() ) )
HB_SocketClose( ::pSocket )
RETURN .F.
ENDIF
if hb_IsBlock( ::bOnListen )
Eval( ::bOnListen, Self )
endif
::Debug( "LISTEN" )
hb_ThreadStart( {|| ::OnAccept() } )
DO WHILE ! ::lExit
inkey( 0.1 )
if ::bOnProccess != nil
::lExit = eval( ::bOnProccess, Self )
else
::lExit := LastKey() == 27
endif
ENDDO
::End()
RETURN .T.