Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

Websocket suite

Questions and comments specific to a particular plugin should go here.
eatmeimadanish
Experienced User
Posts: 118
Joined: Thu Oct 01, 2009 5:11 pm

Re: Websocket suite

Post by eatmeimadanish »

www.opensourceautomation.com

Pako, you really should look at the work they are doing here. This is a brand new version of what used to be VCRIB. This product uses the RESTful api to control any connected device, and is open source software. This product is already integrated with EG in the soon to be release platform called doggo.
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: Websocket Plugin

Post by krambriw »

Dear Pako,
First of all, a fantastic work you have done! I have already played with it a while.

The Virtual House and EG works fine together for me but it is only Opera browser that seems to connect (see log message below). But there is no more functions between the browser, EG and virtual house.

Code: Select all

07:37:53   WebsocketSuite.ClientConnect (u'Virtual_House', ('192.168.10.248', 56518))
I have tested on Vista and XP, same result.

Opera: working partly, can connect but nothing more (the client is connected to the websocket server but no details of the webclient is listed in the plugin setting view)

Firefox, Chrome, Black Hawk (Chrome clone?): no function at all

I think the problem is that the browsers have changed the protocol because there was security issues discovered in earlier versions of websockets.

This test shows that Opera, Chrome and Black Hawk is supporting websockets and here the functions are working fine.

http://websocket.org/echo.html


Best regards, Walter
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: Websocket Plugin

Post by Pako »

krambriw wrote:Black Hawk (Chrome clone?)
Yes, Blackhawk is based on the Chromium source code.

krambriw wrote:Firefox, Chrome, Black Hawk: no function at all
I think the problem is that the browsers have changed the protocol because there was security issues discovered in earlier versions of websockets.
This test shows that Opera, Chrome and Black Hawk is supporting websockets and here the functions are working fine.
It's weird.
Which versions you use?
I have Chrome 14.0.835.202 (used WebSocket protocol hybi-draft-08)
and BlackHawk 1.0.305.0 (used old WebSocket protocol draft-76).
Try this test page !

Pako
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: Websocket Plugin

Post by krambriw »

Hello Pako,

It seems my browser are all working fine with websockets but it is only Opera (using draft-76) that is working with cfull1's websocket server. It might be something in my environment but it is the same if I connect locally or over LAN. When I test your Websocket Suite, I test local connection (everything in the same PC).

Test results from the web page link you proved:

Firefox 7.0.1:
WebSockets supported YesÔ£ö
HTTP Proxy No
WebSocket protocol version hybi-draft-08

Chrome 14.0.835.202 m:
WebSockets supported YesÔ£ö
HTTP Proxy No
WebSocket protocol version hybi-draft-08


BlackHawk 1.0.505:
WebSockets supported YesÔ£ö
HTTP Proxy No
WebSocket protocol version hybi-draft-08


Opera 11.51:
WebSockets supported YesÔ£ö
HTTP Proxy No
WebSocket protocol version draft-76
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: Websocket Plugin

Post by Pako »

Hello Walter !
So Chrome version is absolutely identical.
We need to find out where the cause is.
Please send your screenshot.

Pako
Attachments
ChromeVirtualHouse.png
ChromeAbout.png
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: Websocket Plugin

Post by krambriw »

Hello Pako,

Here my screen shots.
Image1.jpg
Image2.jpg
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: Websocket suite

Post by Pako »

Well. And are you sure that the server is running?
It is possible to connect a client from Websocket suite plugin?

Pako
Attachments
WS_PluginDialog.png
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: Websocket suite

Post by krambriw »

Dear Pako,
I believe the server is running. When I start EG I get this in the log

Code: Select all

17:19:07      Plugin: Virtual House
17:19:07      Plugin: Websocket suite
17:19:07   VirtualHouse.State [0, (0, 22), (0, 22), (0, 22), (0, 22)]
17:19:07   Main.OnInit
17:19:07      On Init
17:19:07         Disable system idle timer
17:19:07         Websocket suite: Start server: Virtual_House: All available interfaces:1234
17:19:07         Now the server is running, we can broadcast
17:19:07         Enable: 
Trying to connect a client from the plugin gives

Code: Select all

17:31:13   Websocket suite: Start client
17:31:13   WebsocketSuite.ClientConnect (u'Virtual_House', ('127.0.0.1', 51333))
Looking at the overview, client count is counting up for each try but no clients are listed
Image2.jpg
Very strange, thanks for fighting this odd problem

Best regards, Walter
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: Websocket suite

Post by Pako »

I see that you have connected 3 clients, but no client (built-in in Websocket suite) is running?
In this case, it must be a web-browser clients ...
I have an idea. We must start the debug-mode.
Please open the __init__.py and find 149th line.
There, type True instead of False.
Then try to connect the client (Chrome).
Send log contents here.

Pako
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: Websocket suite

Post by krambriw »

Hi, interesting...

Trying Chrome and Black Hawk, nothing happens.

Starting the plugin client inside EG add 1 to count connected clients and gives in the log:

Code: Select all

19:54:26   Start client
19:54:26      Websocket suite: Start client
19:54:26         headers = ['GET / HTTP/1.1', 'Upgrade: Websocket', 'Connection: Upgrade', 'Host: 127.0.0.1:1234', 'Origin: 127.0.0.1:1234', 'Sec-WebSocket-Key1: 3`4 8076  # 0 7 34', 'Sec-WebSocket-Key2: 1Tg}1 91115n +008[', '', '\xbaF\xb8\xa5>\xc8EI']
19:54:26         --- request header ---
19:54:26         Server Virtual_House: New client ('127.0.0.1', 53628) tries to connect
19:54:26         GET / HTTP/1.1

19:54:26         Upgrade: Websocket

19:54:26         Connection: Upgrade

19:54:26         get_headers - data: 'GET / HTTP/1.1\r\nUpgrade: Websocket\r\nConnection: Upgrade\r\nHost: 127.0.0.1:1234\r\nOrigin: 127.0.0.1:1234\r\nSec-WebSocket-Key1: 3`4 8076  # 0 7 34\r\nSec-WebSocket-Key2: 1Tg}1 91115n +008[\r\n\r\n\xbaF\xb8\xa5>\xc8EI'
19:54:26         Host: 127.0.0.1:1234

19:54:26         Origin: 127.0.0.1:1234

19:54:26         Sec-WebSocket-Key1: 3`4 8076  # 0 7 34

19:54:26         Sec-WebSocket-Key2: 1Tg}1 91115n +008[

19:54:26         

19:54:26         ┬║F┬©┬Ñ>├êEI
19:54:26         -----------------------
19:54:26         --- response header ---
19:54:26         -----------------------
19:54:26         status = 101
19:54:26         resp_headers = {'sec-websocket-location': 'ws://127.0.0.1:1234/', 'connection': 'Upgrade', 'upgrade': 'Websocket', 'sec-websocket-origin': '127.0.0.1:1234'}
19:54:26         --- challenge response result ---
19:54:26         '\xb6,]\xb9BB\x95\xafP\xadE\x80\xca\t\xd9@'
19:54:26         ---------------------------------
19:54:26         hi
19:54:26         ┬Â,]┬╣BBÔÇó┬»P┬¡EÔé¼├è	├Ö@
19:54:26   closing after reading no data [server ('127.0.0.1', 1234) disconnected]
19:54:26   WebsocketSuite.ClientConnect (u'Virtual_House', ('127.0.0.1', 53628))
Trying Opera sets connected client count to 2 and gives:

Code: Select all

19:57:44   Server Virtual_House: New client ('127.0.0.1', 53693) tries to connect
19:57:44   get_headers - data: 'GET / HTTP/1.1\r\nSec-WebSocket-Key2: 3564<]T9 8 e2I PO35\r\nOrigin: null\r\nHost: localhost:1234\r\nSec-WebSocket-Key1: 84>9 X#aE(1 7*4 3      V 60\r\nUpgrade: WebSocket\r\nConnection: Upgrade\r\n\r\n\x1c\x9d\x14-\xe5\xeb\xfe\xa5'
19:57:44   WebsocketSuite.ClientConnect (u'Virtual_House', ('127.0.0.1', 53693))
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: Websocket suite

Post by krambriw »

Dear Pako,

Some improvements here. Made a fresh install with latest EG and now I can start the Client from the plugin
Image2.jpg
Still not working with any browser. Only Opera gives this in the log:

Code: Select all

07:29:17   Server Virtual_House: New client ('127.0.0.1', 65055) tries to connect
07:29:17   get_headers - data: 'GET / HTTP/1.1\r\nSec-WebSocket-Key2: 69942Q  5742\r\nSec-WebSocket-Key1: 2;,-X7 48438R*633\r\nUpgrade: WebSocket\r\nOrigin: null\r\nConnection: Upgrade\r\nHost: localhost:1234\r\n\r\n\x9f\xdb\r\xc5-\x10\xbf\xf3'
07:29:17   closing after reading no data or invalid data [peer ('127.0.0.1', 65055) disconnected]

Trying more to find the problem...

Best regards, Walter
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: Websocket suite

Post by krambriw »

New test:

I made a config having your WebsocketSuite and cfull1's WebSocket at the same time

Running on a PC with Windows Vista:

WebsocketSuite
Chrome and BlackHawk working with WebsocketSuite
Opera is not working, tries to connect but fails

Code: Select all

11:35:50   Server Websocket_suite_Server: New client ('127.0.0.1', 52971) tries to connect
11:35:50   get_headers - data: 'GET / HTTP/1.1\r\nUpgrade: WebSocket\r\nSec-WebSocket-Key1: 17S94c%4 Nd   N 3 D 5!K3\r\nOrigin: http://192.168.10.252:8181\r\nHost: 127.0.0.1:1234\r\nConnection: Upgrade\r\nSec-WebSocket-Key2: 7V 00X9& 6 2 $5 9  .QL1\r\n\r\nwp\x94y\xf8\x82Ht'
11:35:50   closing after reading no data or invalid data [peer ('127.0.0.1', 52971) disconnected]
WebSocket
Opera is working with WebSocket
Chrome and BlackHawk not working, connects and disconnects right away

Code: Select all

11:31:34   Not using challenge + response
11:31:34   Handshake successful
11:31:34   WebSocket.ClientConnected
11:31:34   Client ready for reading 976
11:31:34   Closing Client 976
11:31:34   WebSocket.ClientClosed
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: Websocket suite

Post by Pako »

krambriw wrote:Hi, interesting...
Trying Chrome and Black Hawk, nothing happens.
krambriw wrote:New test:
I made a config having your WebsocketSuite and cfull1's WebSocket at the same time
Running on a PC with Windows Vista:
WebsocketSuite
Chrome and BlackHawk working with WebsocketSuite
I thank you that you devote so much effort to this problem.
It's really strange behavior.
Still do not know how this is possible.
And I fear also that I never find the cause (if I fail to simulate your situation).

Pako
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: Websocket suite

Post by krambriw »

Dear Pako,

After looking into the code and reading about websockets, my theory is that your websocket suit implements a later protocol that is supported by Chrome whereas cfull1's implementation is supporting an older version that is supported by Opera.

There is still a lot of work ongoing regarding websockets and new versions are so far not backward compatible (which then breaks existing implementations)

Best regards, Walter
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: Websocket suite

Post by Pako »

krambriw wrote:my theory is that your websocket suit implements a later protocol that is supported by Chrome whereas cfull1's implementation is supporting an older version
It is quite obvious. I know it from the very beginning.
Websocket suite plugin supports both versions, but does not work with Opera.
But working with the old BlackHawk, which also uses the old protocol.



Maybe I misunderstood.
I understood so that Websocket suite plugin works only if there is simultaneously installed plugin Websocket too.
Or now works Websocket suite plugin completely normal?


Pako
Post Reply