Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

connecting to httprd gets No WebSocket UPGRADE hdr: None #4

Open
te-anhydros opened this issue Jan 6, 2025 · 7 comments
Open

connecting to httprd gets No WebSocket UPGRADE hdr: None #4

te-anhydros opened this issue Jan 6, 2025 · 7 comments

Comments

@te-anhydros
Copy link

We installed httprd per the README.md.
We start httprd and see the following response from the shell:

$ python /usr/local/src/httprd/httprd.py --port 12345 --password=FOO --view_password=BAR --fullscreen
======== Running on http://0.0.0.0:12345 ========
(Press CTRL+C to quit)

When I connect from a browser running on 1.2.3.5 with http://1.2.3.4:12345/connect_view_ws?password=FOO, the browser does not show the desktop display, but only returns:

No WebSocket UPGRADE hdr: None
 Can "Upgrade" only to "WebSocket".

And the console shows the message:

[06.01.2025-21:16:00] 1.2.3.5 GET [VIEW] /connect_view_ws?password=FOO

What did I miss? How do I resolve this?

@bitrate16
Copy link
Owner

Something related to aio-libs/aiohttp#7224

Will investigate later

@bitrate16
Copy link
Owner

@te-anhydros are you trying to connect directly to _ws endpoint in browser address bar? If yes, It does not work like that. You need to open http://1.2.3.4:12345 instead

@te-anhydros
Copy link
Author

te-anhydros commented Jan 7, 2025

@bitrate16

I tried http://1.2.3.4:12345/?password=FOO and saw the following in the console:

[07.01.2025-08:53:59] 192.168.0.117 GET /?FOO
[07.01.2025-08:54:00] 192.168.0.117 GET [NO ACCESS] /connect_view_ws?password=
[07.01.2025-08:54:01] 192.168.0.117 GET [NO ACCESS] /connect_input_ws?password=
[07.01.2025-08:54:06] 192.168.0.117 GET [NO ACCESS] /connect_view_ws?password=
[07.01.2025-08:54:07] 192.168.0.117 GET [NO ACCESS] /connect_input_ws?password=
[07.01.2025-08:54:12] 192.168.0.117 GET [NO ACCESS] /connect_view_ws?password=

and repeat.

I tried http://1.2.3.4:12345 and saw the following in the console:

[07.01.2025-08:56:08] 192.168.0.117 GET /
[07.01.2025-08:56:08] 192.168.0.117 GET [NO ACCESS] /connect_view_ws?password=
[07.01.2025-08:56:09] 192.168.0.117 GET [NO ACCESS] /connect_view_ws?password=
[07.01.2025-08:56:09] 192.168.0.117 GET [NO ACCESS] /connect_input_ws?password=
[07.01.2025-08:56:15] 192.168.0.117 GET [NO ACCESS] /connect_view_ws?password=
[07.01.2025-08:56:15] 192.168.0.117 GET [NO ACCESS] /connect_input_ws?password=
[07.01.2025-08:56:21] 192.168.0.117 GET [NO ACCESS] /connect_view_ws?password=
[07.01.2025-08:56:21] 192.168.0.117 GET [NO ACCESS] /connect_input_ws?password=

and repeat.

How do we convey the password from the browser via the URL?

@te-anhydros
Copy link
Author

te-anhydros commented Jan 7, 2025

@bitrate16 you wrote:

Something related to aio-libs/aiohttp#7224

Will investigate later

I see in this comment to that issue:

What do you mean by open in browser? They are Websocket endpoints, so you'd need to write some JS to open a websocket, right?

Oh ... looks like I get the issue, it is just not possible to upgrade to WebSocket using browser ...

Please excuse my ignorance, which is vast.

Is a browser inappropriate for connecting to an httprd server? Is there a browser extension (chrome or firefox) that does have the necessary JS to open a websocket?

Thanks!

@bitrate16
Copy link
Owner

Is a browser inappropriate for connecting to an httprd server? Is there a browser extension (chrome or firefox) that does have the necessary JS to open a websocket?

When you connect through address bar, it sends plain HTTP request and does not support UPGRADE to websocket. If you need to view the websocket stream, you need a websocket client. Also, since it's using custom protocol, you won't see the image through the direct connection, just raw data that needs to be decoded.

I would suggest to open http://1.2.3.4:12345 and set password to view

@te-anhydros
Copy link
Author

Hi @bitrate16,

You wrote:

I would suggest to open http://1.2.3.4:12345 and set password to view

Please also suggest which tool(s) that we can use to open http://1.2.3.4:12345 that will allow viewing and using the X display server. Ideally, this would be an extension to Firefox or Chrome, but if there's something else, please let us know.

Thanks!

@bitrate16
Copy link
Owner

@te-anhydros
There are no tools as far as I know because it is not common standard. Instead you may use vnc or rdp-based solutions for view through X11 sessions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants