Connect to Yahoo Website with


How to connect to Yahoo! Website with program?



If you know how to use commands of the HTTP protocol, you can connect to a Web server with program as shown below:

C:\fyicenter> java 
   -cp .;C:\local\commons-net-3.5\commons-net-3.5.jar
   examples.telnet.TelnetClientExample 80

Type AYT to send an AYT telnet command
Type OPT to print a report of status of options (0-24)
Type REGISTER to register a new SimpleOptionHandler
Type UNREGISTER to unregister an OptionHandler
Type SPY to register the spy (connect to port 3333 to spy)
Type UNSPY to stop spying the connection
Type ^[A-Z] to send the control character; use ^^ to send ^

GET / HTTP/1.1 <Enter>

<!DOCTYPE html>
<html lang="en-us">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <meta charset="utf-8">
  <!-- status code : 400 -->
  <!-- Bad Request: - -->
  <!-- host machine: -->
  <!-- timestamp: 1479575995.000 -->
  <!-- url: /-->
          <div id="englishContent">
            <h1 style="margin-top:20px;">Will be right back...</h1>
            <p id="message-1">Thank you for your patience.</p>
            <p id="message-2">Our engineers are working quickly to resolve 
               the issue.</p>

It's not really working, because Yahoo! Web is expecting additional request-header lines in a single request.


Connect to FTP Server with

Connect to with

Using commons-net.jar in Java Programs

⇑⇑ FAQ for Apache commons-net.jar

2017-04-22, 2142🔥, 0💬