Jump to content
McKay Development

Recommended Posts

Posted

If I want to connect my website and node.js server I would need to put the ip of the server in my source code but isn't this unsafe because everyone is able to see this if you use javascript, and people could like attack it or something?

 

Also is using socket.io generally the 'best' way to connect a bot and a website or would using socket.io be called 'non-proffesional' and what other options exist? I also haven't seen a big site using socket.io so that makes me wondering, or do they hide it somehow?

 

 

Posted

socket.io is okay but I don't personally recommend it because I personally think it's a bit too much for what it needs to do. Plain old boring websockets are plenty since there's no real need to support browsers that don't support websockets anymore (they've been standard for years now). I made a websocket library but you can use anything.

 

If you want to protect your server from having its direct IP exposed, you could use Cloudflare. They support websockets even on the free plan.

Posted

But using websockets wouldn't necesarilly be the best way to make a deposit/withdraw system?

I have looked around on big sites such as opskins or sites likes csgoempire/csgoroll or that gambling crap but they

don't seem to be using websockets, which makes me wondering again what they do use for these kinds of systems,

that's why I was thinking about not using socket.io because users could also try to send their own requests.

Posted

Users any way can send their own requests. You should use session like system to detect guest/user request and then do any check you need(for example check if user is admin or user have enough balance)

Posted

If you aren't doing anything that involves the server generating an event and pushing it down to the user, there's no need to use websockets. If all you're doing is request/response stuff then ajax is all you need and is much simpler.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...