Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Prevent certain ports from coming in.  RSS feed

 
Huang Qingyan
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear experts,
As this is a java forum, I gonna ask some programming question.
The stuff is how can I write a java program inorder to block port 80 from coming in or out. Please give me some advice on how to start.
Thanks a lot,
Franco
 
Michael Yuan
author
Ranch Hand
Posts: 1427
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is usually done with firewalls.
But if you really want to do it
in Java, you can write a Java program
that listens at port
80 and just discards all incoming
information.
On most systems, you have to be
administrator to have your program
bind to port 80.
You must free port 80 first and
then run this Java program.
 
Huang Qingyan
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Michael,
Can you please kindly advise me on how to write the codes in the way that it just on certain port and also the method on how to discard the packets that come in on that port.
Warmest regards,
Franco
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!