Author Topic: Chat for HFS.  (Read 171 times)

0 Members and 1 Guest are viewing this topic.

Offline username1565

  • Occasional poster
  • *
  • Posts: 5
    • View Profile
Chat for HFS.
« on: July 08, 2018, 06:05:22 AM »
Hello. I'm from here: https://github.com/rejetto/hfs/issues/7

I'd implemented the file-chat for HFS, using Javascript and JQuery.
This connected to HTTPFileServer, using XHR-queries (you can see this in browser, in console.log).

Source code you can find in attached file, then you can test this.
To make this workable, put (by using drag and drop)
the folder "Upload_messages" inside the main folder of this chat in HFS
and make this uploadable for anyone.

Best regards.
« Last Edit: July 08, 2018, 06:56:33 AM by username1565 »

Offline username1565

  • Occasional poster
  • *
  • Posts: 5
    • View Profile
Re: Chat for HFS.
« Reply #1 on: July 08, 2018, 06:56:47 AM »
Maybe there is possible to add websockets, or another methods, like WebRTC.
Maybe there is possible to add file sharing, webcam-streaming, or voice chat.
In this case, HFS can working just as relay-server (like IRC), or as a STUN-server, without large traffic loading.
STUN server need only to make peer exchange!

For example, this chat https://github.com/ScaleDrone/webrtc-text-chat-tutorial/
can be downloaded as zip, and this working in HFS, like web-based p2p chat,
but only when Internet connection exists.
Else, this not working, and in script.js you can see this:
Quote
stun:stun.l.google.com:19302
This is just a public STUN server for making peer exchange through NAT:
https://gist.github.com/mondain/b0ec1cf5f60ae726202e

In the case of using stun server or relay servers, no need any loading of traffic on HFS,
for example if webcam or voice chat will be using by users.
This users will be a peers, will connected each by each,
and stun server inside HFS
will make the warranty of stable peer exchange in this P2P chat.

Offline username1565

  • Occasional poster
  • *
  • Posts: 5
    • View Profile
Re: Chat for HFS.
« Reply #2 on: July 08, 2018, 07:10:36 AM »
Also, as example, I can leave here this chat: https://www.pubnub.com/developers/demos/10chat/
If two tabs with this, in browser, will be opened together, you can chat with yourself.
This chat not a p2p, and this need to register room or channel on the site pubnub.
But I think traffic will go between peers, and the channel don't save the traffic.
I think this, because reloading the page not give all previous messages.
In this case pubnub channel working as relay server or stun server for peer exchange and then chat is really P2P.
This can working in LAN if stun server or relay server will be inside HFS.

Also, I want to recommend you all to test this WebRTC-examples: https://github.com/muaz-khan/WebRTC-Experiment/
There is examples for file-sharing, voice chat, and webcam-chat,
but this not a p2p, not working in LAN without Interned,
and this all working with requirements for runing server-side code,
and need socket.io, or Peer.js to be runned on node.js.
Node.js source code is to large to be included in HFS server but maybe can using
minify and compactly implementation for requirements only this all.

Offline username1565

  • Occasional poster
  • *
  • Posts: 5
    • View Profile
Re: Chat for HFS.
« Reply #3 on: July 08, 2018, 07:21:42 AM »
Also, I want to recommend you all to see this:



This is web-based interface for Tox!
Here is source code: https://github.com/codedust/WebTox and there is server-side code, writed as .go files.
This must to be compiled and this is a different server.
GO-installer have over 100 MB size. Not good for downloading.

Utox, Toxcore, or http://isotoxin.im/
this all is a P2P-programs, yes this can working in LAN,
and there is, inside the p2p tox-programs, already exists server-side soft.
But tox-programs is not web-based chat. So, webTox can make this web-based.

In this case, compiled go-files code in server-side of webtox
can be included in HFS server code, and working if tox-node will be running.
But I think this will make more sence, if WebTox will be included in server-side code for tox-programs.

So I just leave this here, and you can learn Tox working principles
and include something of this in HFS.
For example, NaCl encryption, with generate private key and public key,
or DHT to make peer exchange - all this can be inside HFS.
« Last Edit: July 08, 2018, 07:28:33 AM by username1565 »

Offline bmartino1

  • Insane poster
  • *****
  • Posts: 758
  • I'm only trying to help i mean no offense.
    • View Profile
    • none - google translate
Re: Chat for HFS.
« Reply #4 on: July 11, 2018, 07:11:53 AM »
https://github.com/heiswayi/hfs-templates/blob/master/HFSTemplate_AllyssaFramework_v1_2.tpl

There already chat boxes in other templates on the forum such as thunder chicken of glore, etc etc...

I don't know if you asking for help on addons or just shrong something you'd like to see implemented in to hfs.

???
I'm only trying to help i mean no offense.
thank you for your time and patience,
Bmartino1

Offline username1565

  • Occasional poster
  • *
  • Posts: 5
    • View Profile
Re: Chat for HFS.
« Reply #5 on: July 14, 2018, 03:09:09 PM »
https://github.com/heiswayi/hfs-templates/blob/master/HFSTemplate_AllyssaFramework_v1_2.tpl
Thanks for the link of templates by Heiswayi Nrird. I see there very nice templates.
Also, I see there is working hfs.exe too - this is version 2.2f.

There already chat boxes in other templates on the forum such as thunder chicken of glore, etc etc...
Can you tell me the link for templates:
Quote
thunder chicken of glore, etc etc...
?

I tryed use "Allyssa Framework v1.2" from your link, and I see there, inside HTML code:
Code: [Select]
<iframe id="iframe" frameborder="0" src="http://findbetterresults.com/?dn=freeshoutbox.net&amp;pid=9PO755G95"
style="display: none !important;"></iframe>
And this is not working with Internet. I see the errors in console.log (F12 button in browser).
Also, this chat must not to working WITHOUT INTERNET,
and I want to see the chat to be workable in LAN (Local Network).

My chat is working in LAN without INTERNET, but this is not so ellegant.
If there will be 1 million messages, each user must to save this all - as different files, for each page-request.  ;D
This is only demo-example for you all, to think about it.

I don't know if you asking for help on addons or just shrong something you'd like to see implemented in to hfs.
???
I don't see any addons with chat, so I just leave this code here.
At last, in the future, maybe I want to see good server-side chat inside HFS,
without any rooms or channels on another servers/services.

Maybe there can be possible, to realize VOIP, video conference, torrent tracker, and another P2P technologies,
if relay server or stun server will be using to do connection between LAN-peers, without need the Internet.

Best regards.
« Last Edit: July 14, 2018, 03:27:36 PM by username1565 »

Offline bmartino1

  • Insane poster
  • *****
  • Posts: 758
  • I'm only trying to help i mean no offense.
    • View Profile
    • none - google translate
Re: Chat for HFS.
« Reply #6 on: July 15, 2018, 09:18:57 AM »
I'm only trying to help i mean no offense.
thank you for your time and patience,
Bmartino1

Offline LeoNeeson

  • Insane poster
  • *****
  • Posts: 437
  • Solitario...
    • View Profile
    • twitter.com/LeoNeeson
Re: Chat for HFS.
« Reply #7 on: July 16, 2018, 02:25:05 AM »
@username1565: Your idea is very interesting. I've tested it, and it works well, but I've also found some issues and ideas for enhancements.

Possible small enhancements:
- (Bug) if we insert ":" in a message, then any text/word after that is not shown.
- Automatically scroll-down messages, so we can always see the last posted message.
- Show the number of users online, or even better, have a simple online user list.
- Save/remember nickname on a cookie, and allow change nickname when clicking on it.
- Add an optional 'Send' button (as a fail-over, for old browsers not detecting when the 'Enter' key is pressed).

Possible complex enhancements:
- Privacy: If possible, save messages using the epoch Unix Time, to avoid someone automatically stealing all the messages, since it's currently searching for "message (2).txt", "message (3).txt", etc. which can be easily guessed. But since this can be very complex to implement, I have another better idea:

- Add a private chat mode: when a private chat with some user is started, a new window is opened, and a new -temporal- folder is created on HFS, with a random folder name (for example "TempChat-5560AFHG"), so, another users can't guess the folder path and steal or retrieve private chats. Folder name should be automatically exchanged in background, without user intervention. And when one of the users close your browser, the private chat ends, and the another user gets a message like 'John has closed this chat' (similar as IRC). And then, we can also automatically delete that temporal folder, when both parts close the window. We can also create a -permanent- private chat (with a folder name like "PermChat-EASY777"), adding a button to make it, so if 2 users know the 'private chat name' (aka: private chat folder name), for example "EASY777", then, they can join the chat anytime without having to post anything on the public chat (that folder stores the messages permanently). So basically, we can have a public chat, and a private chat and all without a database or anything special.

You can also check the chat made by DJ, here (which can give you some new fresh ideas).

Cheers,
Leo.-
• HFS ahora también disponible en Español! (Clic aqui) :)
• HFS is now also available in Spanish! (Click here)