rejetto forum

Software => HFS ~ HTTP File Server => Topic started by: username1565 on October 23, 2019, 01:14:52 AM

Title: Maybe... Websockets?!!
Post by: username1565 on October 23, 2019, 01:14:52 AM
Is there any ability for HFS to working with WEBSOCKETS?
I cann't found keyword "websockets" on this forum.
Can you realize this ability? In this case, users can chat with server, using only one connection,
and no need to send many XHR-queries and open many connections.
I have Websocket server, writted on c# here: https://github.com/username1565/Fleck2
See source code, and this issue: https://github.com/username1565/Fleck2/issues/1
For introduction, and test this, if you still have not work with Websockets.

Have a nice day!
Title: Re: Maybe... Websockets?!!
Post by: rejetto on October 23, 2019, 12:44:23 PM
hi, websockets are nice, but hfs is missing much more basic features, considering its file-server nature :)
Title: Re: Maybe... Websockets?!!
Post by: Mars on October 23, 2019, 08:41:30 PM
@1565

You can convert your websockets server as a proxy to translate request to hfs with some spécial section
Title: Re: Maybe... Websockets?!!
Post by: username1565 on October 23, 2019, 10:11:32 PM
@1565

You can convert your websockets server as a proxy to translate request to hfs with some spécial section
Ok. Good. But I think, will be better to you can realize this as separate internal module.
For example, to do live updating the dynamic data, or chat, or show the stats about downloading on the webpage,
will be better to keep one connection with client,
and do not accept from this client many connections, after sending each query on the server,
which will be closed by client, after receive response.
But if you offer to open many connections on the proxy, then this websocket-connection have no any sence,
and server loading still not will be lower. ;D

hi, websockets are nice, but hfs is missing much more basic features, considering its file-server nature :)
I just leaved it here, because if you have free time, you can just for fun, see the documentation, about how it works,
and see that source code, about how to implement it, up to .NET Framework 2.0,
and maybe, using this code, you can implement this too, but on Objective Pascal, and more easy.

Cheers!
Title: Re: Maybe... Websockets?!!
Post by: bmartino1 on October 26, 2019, 09:41:10 PM
may be with ubuntu wine and some iptable/ firewall commands.
Title: Re: Maybe... Websockets?!!
Post by: rejetto on January 30, 2020, 06:06:28 PM
my attempt at building HFS 3 included websockets, with real-time refreshing of the file list :)
https://github.com/rejetto/hfs

sadly i don't have currently time to bring on that project
Title: Re: Maybe... Websockets?!!
Post by: dj on February 01, 2020, 07:20:11 AM
you can use Server-sent events (https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events)

I've used it last in Video player to watch with friends (http://rejetto.com/forum/index.php?topic=13173.0) and earlier in my Chat application
Title: Re: Maybe... Websockets?!!
Post by: rejetto on February 03, 2020, 03:59:05 PM
SSE is interesting for cases when it's hard to get websockets.
At work we created something very similar 1 year ago, not knowing this standard, otherwise we would have followed it.
Pity Edge doesn't support it.
Title: Re: Maybe... Websockets?!!
Post by: dj on February 03, 2020, 05:11:18 PM
Edge79 (is being rolled out. I don't have it yet) supports (https://caniuse.com/#feat=eventsource) it

in my aforementioned apps I fallback to polling if not supported

Title: Re: Maybe... Websockets?!!
Post by: rejetto on February 04, 2020, 03:37:12 PM
and it seems it can be polyfilled
https://www.npmjs.com/package/event-source-polyfill