Minecraft PC IP: play.cubecraft.net

_Oplex_

Dedicated Member
May 5, 2016
694
1,059
198
Under Your Bed (O.o)
So lets say i have 2 people. And they both go on the same page. All they see is a empty textArea. If person1 would edit the text i want to also change the text on person2 screen. First i want to try simple ajax, but that is just not a good solution.
Now im thinking about a server side event. Would that work? I googled about it and it looks good to me. But are there any other things i can try?
It can be simple or complex.
 

DrHam

Forum Veteran
Sep 15, 2015
3,615
4,163
518
Kepler-452b
Like a chat?
Ajax is a nice, simple solution iirc

How would you implement a server side solution for “live changes” without refreshing?

Don’t take my advice as something 101% correct
 

_Oplex_

Dedicated Member
May 5, 2016
694
1,059
198
Under Your Bed (O.o)

Max ♠

Forum Expert
Feb 20, 2016
1,420
2,940
344
24
North pole
Now im thinking about a server side event. Would that work? I googled about it and it looks good to me. But are there any other things i can try?
It can be simple or complex.
SSE seems to be the best option, wouldnt recommend PHP for this however, Node seems like a much better fit

Something janky with ajax could also work, although like you said, not the best option.

There's also a library for SSE in PHP, don't know how well it works, https://github.com/licson0729/libSSE-php
 
  • Like
Reactions: _Oplex_ and DrHam

_Oplex_

Dedicated Member
May 5, 2016
694
1,059
198
Under Your Bed (O.o)
Node seems like a much better fit
Yep, that would be great. but the server i want to host this on has also a mail client on it. I am not that experienced with setting up such thing with ports etc. I am now using socket.io and that is actually what i want. It works fast and easy.

im just making it. and the server would be a problem on a later stage. thx @A Christmas Hangar and @zivdnaL
 
  • Like
Reactions: Max ♠

LazosPlaying

Well-Known Member
Sep 13, 2016
9
9
78
23
Slovenija
aljaxus.eu
Yeah you should use sockets for that. xhr requests are totally not the answer for "live editing" because they open a new connection every time they fire while with sockets you basically have one unclosed connection. Keep us updated on how things go ^-^
 
Members Online

Team online

Latest profile posts

This is YOUR daily dose of facts #20-
More tornadoes occur in the United Kingdom per square mile than in any other country in the world.
TheOrderOfSapphire wrote on Capitan's profile.
Congratulations on hitting over 4 000 in Reaction Score! 💙
some people need to talk to their internet provider to buy them a gym membership because theyre too FAT to take knockback
Top Bottom