HMGSCRIPT 2012: Programming For The Web in The Right Way :)

Moderator: Rathinagiri

jparada
Posts: 433
Joined: Fri Jan 23, 2009 5:18 pm

Re: HMGSCRIPT 2012: Programming For The Web in The Right Way

Post by jparada »

Hola,

Para mi funcionó sin problemas, gracias al tip de Rathinagiri, copiar std.ch and set.ch al folder donde se encuentra wssocket.exe.

Gracias.

Saludos,
Javier
User avatar
Roberto Lopez
HMG Founder
Posts: 4023
Joined: Wed Jul 30, 2008 6:43 pm

Re: HMGSCRIPT 2012: Programming For The Web in The Right Way

Post by Roberto Lopez »

jparada wrote:Hola,

Para mi funcionó sin problemas, gracias al tip de Rathinagiri, copiar std.ch and set.ch al folder donde se encuentra wssocket.exe.

Gracias.

Saludos,
Javier
La última versión ya no lo necesita.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
luisfrancisco62
Posts: 66
Joined: Thu Mar 18, 2010 12:16 am
Location: Colombia
Contact:

Re: HMGSCRIPT 2012: Programming For The Web in The Right Way

Post by luisfrancisco62 »

los felicito por tan grandioso experimento me gustaria saber mas y obtener mas codigo, como se haria con bases de datos?

gracias muchas gracias
User avatar
Roberto Lopez
HMG Founder
Posts: 4023
Joined: Wed Jul 30, 2008 6:43 pm

Re: HMGSCRIPT 2012: Programming For The Web in The Right Way

Post by Roberto Lopez »

Hi All,

I', facing two problems with the server and I'm asking for help.

1. I've done a server function that retrieves a query in the form of an html table. The problem is that the browser claims that the message is too large.

Experimenting I've noticed that the maximum message length that works is 127 characters.

This is not a protocol limitation but a server limitation.

About line#260 in wssocket.prg you'll find the line that must be modified:

Code: Select all

oClient:SendData( Chr( 129 ) + Chr( Len( cAnswer ) ) + hb_StrToUtf8( cAnswer ) )
I've read protocol specification and I've attempted modified versions of this line, but it not worked.

2. We are unable to connect to the server from Safari.
I'm getting the message "file://Error during WebSocket handshake: 'Sec-WebSocket-Origin' header is missing".
It could no appear as a serious problem, but considering that iPads and iPhones uses it, we are in trouble :)

I've tested on Safari for Windows, but I'm pretty sure that it will fail on OSX and IOS versions too, since probably they share the same code.

Any help on any of this problems is greatly welcome.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
Roberto Lopez
HMG Founder
Posts: 4023
Joined: Wed Jul 30, 2008 6:43 pm

Re: HMGSCRIPT 2012: Programming For The Web in The Right Way

Post by Roberto Lopez »

luisfrancisco62 wrote:los felicito por tan grandioso experimento me gustaria saber mas y obtener mas codigo, como se haria con bases de datos?

gracias muchas gracias
No hay ejemplos con bases de datos todavía, pero sería muy simple hacerlo modificando los demos actuales.

El único problema por resolver, es que la longitud de los mensajes del servidor hacia el cliente, no puede ser mayor de 127 caracteres. El server debe ser modificado para lograrlo.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
Rathinagiri
Posts: 5481
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: HMGSCRIPT 2012: Programming For The Web in The Right Way

Post by Rathinagiri »

I also see that many HTML5 input data types are not implemented in FireFox or Opera. But they are implemented in Chrome.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
Roberto Lopez
HMG Founder
Posts: 4023
Joined: Wed Jul 30, 2008 6:43 pm

Re: HMGSCRIPT 2012: Programming For The Web in The Right Way

Post by Roberto Lopez »

rathinagiri wrote:I also see that many HTML5 input data types are not implemented in FireFox or Opera. But they are implemented in Chrome.
Yes. The most notable is date on Chrome that not displays a calendar.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
IMATECH
Posts: 188
Joined: Sun May 27, 2012 9:33 pm
Location: Brazil: Goiânia-GO.

Re: HMGSCRIPT 2012: Programming For The Web in The Right Way

Post by IMATECH »

Below another project with sockets (Maybe has something usefull)...



This Project is started at harbour developer group and made from Daniel Garcia Gil e Antonio Linares

You need a HTML5 WebSockets support capable Internet browser like Chrome. Unfortunately IE does not apply. IE is behind its competitors regarding HTML5 support. Thats why I use Chrome, and also because it is much faster. Microsoft has promised a new version with HTML5 support but it seems as it is not ready yet.
Internet Explorer 10 and Metro style apps using JavaScript add support for the WebSocket API as defined in the W3C's HTML5 specification on the WebSocket API, which is currently in the Working Draft stage.

http://code.google.com/p/harbour-websocket/


Image



here you can test if your browser support websocket: Real-Time Web test – Does HTML5 WebSockets work for you?

http://websocketstest.com/
M., Ronaldo

By: IMATECH

Imation Tecnologia
User avatar
danielmaximiliano
Posts: 2646
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: HMGSCRIPT 2012: Programming For The Web in The Right Way

Post by danielmaximiliano »


here you can test if your browser support websocket: Real-Time Web test – Does HTML5 WebSockets work for you?

http://websocketstest.com/
Ronaldo : obrigado pela informação, meu teste passo firefox
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
User avatar
Roberto Lopez
HMG Founder
Posts: 4023
Joined: Wed Jul 30, 2008 6:43 pm

Re: HMGSCRIPT 2012: Programming For The Web in The Right Way

Post by Roberto Lopez »

Hi,

I've found information about data-framing in websockets. This information will allow us to change the server code to make it able to send messages larger than 126 bytes.

To implement it, I need to use the following operators:

- Bitwise AND (& in C)
- Bitwise OR (| in C)
- Bitwise right shift ( >> in C)

Does anybody knows if are these operators available in Harbour (or any Harbour contrib library)?

TIA.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
Post Reply