Mnt-STVN Posted December 11, 2017 Report Posted December 11, 2017 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? Quote
Dr. McKay Posted December 11, 2017 Report Posted December 11, 2017 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. Mnt-STVN 1 Quote
Mnt-STVN Posted December 11, 2017 Author Report Posted December 11, 2017 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 theydon'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. Quote
TarasDev Posted December 11, 2017 Report Posted December 11, 2017 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) Quote
Dr. McKay Posted December 11, 2017 Report Posted December 11, 2017 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. Quote
Recommended Posts
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.