E
E
elleremo2014-09-01 03:06:33
JavaScript
elleremo, 2014-09-01 03:06:33

What technologies to choose for chat?

Please indicate in which direction to move.
I plan to make a site with an anonymous chat, like a chat for two.
Now I'm learning HTML, CSS, Jscript. Haven't studied anything else yet. Zero in programming.
While understood only that that asynchronous processing of the data on the server is necessary.

The following questions arose :
1 . Which server to choose, because there are a lot of clientA-server-clientB requests?
I mean Apache, nginx, php-fpm etc. (How it all works - I understand badly)
2 . What technology/bundle or protocols to choose actually for message passing?
WebSocket, Ajax, etc. ( I also do not know what and how )
3 . With what can the above asynchrony be done?
4 . Are there any technologies / protocols for transferring data from clientA to clientB, i.e. from browser to browser, bypassing the server?

Please forgive me if I'm asking the wrong questions. Thanks to everyone who answers.

Answer the question

In order to leave comments, you need to log in

6 answer(s)
A
Alexander Taratin, 2014-09-01
@Taraflex

socket.io/get-started/chat

Y
yernende, 2014-09-01
@yernende

I will add to the rest of the answers that you do not need JScript, but javascript. JScript is a microsoft implementation, and it's used in a completely different place. The web pages use javascript.
Node.js is a server-side implementation of javascript. I would also advise him - firstly, you will need to learn fewer languages ​​(well, you still need to know a lot of languages, but at first you won’t get confused), and secondly, he is perfect for this role. Like python, but its syntax is very, very different from js, which can cause confusion. Actually for communication there are two options - either pure WebSocket or socket.io. Socket.io is a module for node.js that uses the best browser-supported communication technology to provide full duplex communication. If WebSocket is supported - it uses it, if it is not supported - it uses crutches.
Related links:
learn.javascript.ru/intro - an introduction to javascript. It's a must read.
learn.javascript.ru/websockets - about websockets (there is also an example of a chat).
learn.javascript.ru/nodejs-screencast - Node.js screencast
socket.io - about socket.io, there is an example of a chat with sources in the demos.

E
Evgeny Petrov, 2014-09-01
@Petroveg

Your need relates to WebRTC . Unfortunately, only Firefox, Chrome, Opera support the technology (and that's because it switched to the webkit engine). Therefore, it is almost impossible to do without a server.
WebRTC #1 -
Getting to know How we did the service on WebRTC
Therefore, most likely, you will have to use WebSocket - still better than endless client AJAX requests to the server. Ready-made solutions in bulk.

V
VaaL2004, 2014-09-01
@VaaL2004

I recommend a bunch of Node.js, socket.io and redis.
Node.js will act as a web server and give asynchrony
Socket.io will give cross-browser communication between the client and the server, plus it can address messages to specific users.
Redis in your case will be good as a chat base (I understand that long-term storage is not expected)
If you need help, write to the mail ([email protected]), we will exchange contact details

Y
Yuri Belyakov, 2014-09-01
@theBookoff

I would advise you the Tornado asynchronous web server, well, you need to know a little Python for it.
Here seems to be a good example: https://code-live.ru/post/chat-with-tornado-backbo... which you can try out and refine.

V
Viktor, 2014-10-19
@Levhav

If you have a lot of requests, which is what you are planning, then either learn node.js or there is another option to use a ready-made comet server and communicate with it via api.
That is, for example, you have a regular php site, and all the work and the load of maintaining constantly open WebSocket connections is taken over by the comet server.
With your experience, I think it would be advisable to use the comet server represented by the saas model, this will greatly speed up and simplify your project writing.
Here are a few comet services.
[Ru] comet-server.ru/menu_id/10
[En] https://www.tambur.io/pricing
[En] pusher.com/pricing

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question