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,166
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
24
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

ItzJuan wrote on Reesle's profile.
Thanks for the follow, Reesle!
(1/2)
I was going through my old “suggestion archives” and found my old “Outer Space Bundle” suggestion that I had made before the Galaxy Bundle was ever announced.
IMG_6810.jpeg
lorilambthecoolgamer wrote on Reesle's profile.
BRUV NICE JOB AT GETTING 6,000+ REACTION SCORE!
BicolourSine41 wrote on Reesle's profile.
waitttt, CONGRATZZ ON 6K MESSAGES!!!!!!!!!!!!!!!!!
Very good job, well deserved!
WorriedSkate940 wrote on zMohqm's profile.
Pro
Top Bottom