Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (102)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (322)
Collections:
Other Resources:
Connect to Yahoo Website with TelnetClientExample.java
How to connect to Yahoo! Website with examples.telnet.TelnetClientExample.java program?
✍: FYIcenter.com
If you know how to use commands of the HTTP protocol,
you can connect to a Web server with examples.telnet.TelnetClientExample.java program
as shown below:
C:\fyicenter> java
-cp .;C:\local\commons-net-3.5\commons-net-3.5.jar
;C:\local\commons-net-3.5\commons-net-examples-3.5.jar
examples.telnet.TelnetClientExample www.yahoo.com 80
TelnetClientExample
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">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<title>Yahoo</title>
</head>
<body>
<!-- status code : 400 -->
<!-- Bad Request: - -->
<!-- host machine: ir1.fp.bf1.yahoo.com -->
<!-- timestamp: 1479575995.000 -->
<!-- url: /-->
<table>
<tbody>
<tr>
<td>
<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>
</div>
</td>
</tr>
</tbody>
</table>
</noscript>
</body>
</html>
It's not really working, because Yahoo! Web is expecting additional request-header lines in a single request.
⇒ Connect to FTP Server with TelnetClientExample.java
⇐ Connect to telehack.com with TelnetClientExample.java
2017-04-22, ∼3317🔥, 0💬
Popular Posts:
Java Cryptography Extension 1.6 JAR File Size and Download Location: File name: jce.jar, jce-1.6.jar...
JDK 11 jdk.compiler.jmod is the JMOD file for JDK 11 Compiler tool, which can be invoked by the "jav...
JDK 17 jdk.incubator.vector.jmo dis the JMOD file for JDK 17 HTTP Server module. JDK 17 Incubator Ve...
JDK 1.1 source code directory contains Java source code for JDK 1.1 core classes: "C:\fyicenter\jdk-...
JDK 11 java.xml.jmod is the JMOD file for JDK 11 XML (eXtensible Markup Language) module. JDK 11 XML...