Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Chat program that sits on public server (2 Questions)

 
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello, Im moving into Streams, Sockets etc, and want to set up a chat server. I already have a server program that I'm running locally and its working fine along with the client program, fine being they can communicate effectively. I want to move the server side onto a actual server how would I go about doing this? I already have a hosting account where my websites sit, do I need a new domain etc?



Question (2) I will be adding to this program by allowing people to sign up by downloading the client side app and being prompted for create credentials and send this to the database. How do I incorporate these two things together ( server-side program & database ) this is where Im getting confused , thanks for your help in advance, I'm excited to be moving into this!
 
Sheriff
Posts: 26973
85
Eclipse IDE Firefox Browser MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

travis Haycock wrote:Hello, Im moving into Streams, Sockets etc, and want to set up a chat server. I already have a server program that I'm running locally and its working fine along with the client program, fine being they can communicate effectively. I want to move the server side onto a actual server how would I go about doing this? I already have a hosting account where my websites sit, do I need a new domain etc?



You'd have to talk to your existing hosting provider to see if what you have already allows you to run servers (other than the one serving your websites already).


Question (2) I will be adding to this program by allowing people to sign up by downloading the client side app and being prompted for create credentials and send this to the database. How do I incorporate these two things together ( server-side program & database ) this is where Im getting confused , thanks for your help in advance, I'm excited to be moving into this!



You can (and should) test this in the same place you're already testing. You're going to have to expand your existing communication protocol to include messages which say "Hi I'm new please sign me up" and "Hi it's me again here's my ID and password" and so on. Work on this by drawing pictures first. Does your existing protocol keep track of user IDs and send them out to clients to identify who is talking? If not then it should. (You do have a protocol which describes the types of messages sent between the server and client, and what sort of messages you expect in return, and so on, don't you?)

And you're going to be sending passwords over the Internet. So you'll need to use proper security. You can't be secure without using HTTPS for your web site, so you'd need to check with your hosting provider about getting a security certificate for your chat site. And you should never store passwords in your database in plain text. You should hash them before writing them into the database, and when somebody tells you "This is my password" you should hash what they give you and compare that to the hashed data in the database.

Don't take that brief paragraph as a tutorial, either. It's not even a summary of best practices in the area. You should search out much more complete information on the web.
 
travis Haycock
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Paul, appreciate the input and will keep it in mind.
 
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic