• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Sample Socket Server Online or Local

 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Socket Testing With Credentials

We want to test Socket program where

a. we need to pass credentials - user name and password
b. after success, we need to send couple of request to get the response

1. Is any Free API available which accepts credentials and can test couple of request ?

2. Is there is any free windows tool is available to act as server to configure and connect using credentials and provides responses when we connect the server. Couple of sample request and response to be tested.

Thanks.
 
Saloon Keeper
Posts: 15510
363
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I strongly suggest you use an established protocol to send credentials as encrypted cipher text, because you don't want them to be intercepted in transit. Since writing your own protocol on top of TLS might be a lot of work, it's maybe easiest to send HTTPS messages.

You can then use any web server to accept the requests, and if you configure middleware to check the credentials you're done.
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"Socket" programs are out of style. It's rarely worth the effort to define and debug and secure a new protocol from the ground up and firewalls used these days tend to limit the ports that can be used without getting the network people involved.

Probably the easiest, and best supported "socket" protocol these days is to simply use a web service. And J2EE/JEE have security mechanisms built into their specs, which can be augmented by established (and debugged) add-ons like Spring Security.

Another alternative is to use a messaging service, such as JMS. It's less firewall-friendly, but it allows for store-and-forward operations.

A third option is RMI. RMI is very low overhead, but you have to supply your own security protocols, it requires compatible JVM versions on both client and server sides. and clearance through any intervening firewall(s). A variant of this is remote EJBs. Actually, RMI-IIOP may reduce some of the earlier problems I mentioned with RMI, but it has been a while since I looked. RMI isn't very popular these days and its bare-bones services put more of a documentation and support burden on your local infrastructure.

There was a fourth option - CORBA, which is similar to RMI, except that clients could be in many languages, not just Java. CORBA was a "must have" skill in the 1990s, but died rather quickly when people started raising firewalls, since CORBA didn't work with fixed ports and was thus inimical to firewalls. It was essentially replaced by SOAP, which in turn was replaced by web services. CORBA is no longer supported in Jakarta JEE and vendor support for CORBA is nearly or completely dead at this point.
 
Kathir jeyap
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your detailed explanation, Tim Holloway.

The client will be giving us just an API with credentials once POC is done and we need to connect via Socket

Assume we need to use Socket and help me with the answers
 
Bartender
Posts: 667
14
TypeScript Fedora
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think this guy is just asking how to make http requests with java it seems like.  
 
Ranch Hand
Posts: 218
5
MS IE Notepad Suse
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't want to sound rough - so I try to ask my assumption as a question: Do you know what you need and what it should provide?

As I read the topic line I first thought sarcastic: Every socket is local to the machine it's created on - and only becomes "online" when one can establish a route to this endpoint via the systems public IP (through what ever might be in the way from pop-uplink (most likely some sort of modem or router) to the machine).

Your questions are to vague to guess what you're askin for.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic