不使用telnet进行端口测试的方法

不使用telnet进行端口测试的方法

 

  • 测试通过样例
  • 复制代码
    [root@ip203 ~]# curl -v 10.0.0.210:8082
    * About to connect() to 10.0.0.210 port 8082 (#0)
    *   Trying 10.0.0.210...
    * Connected to 10.0.0.210 (10.0.0.210) port 8082 (#0)
    > GET / HTTP/1.1
    > User-Agent: curl/7.29.0
    > Host: 10.0.0.210:8082
    > Accept: */*
    > 
    < HTTP/1.1 200 OK
    < Content-Type: text/html
    < Cache-Control: no-cache
    < Content-Length: 938
    < 
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <!--
    Copyright 2004-2019 H2 Group. Multiple-Licensed under the MPL 2.0,
    and the EPL 1.0 (https://h2database.com/html/license.html).
    Initial Developer: H2 Group
    -->
    <html><head>
        <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
        <title>H2 Console</title>
        <link rel="stylesheet" type="text/css" href="stylesheet.css" />
    <script type="text/javascript">
    location.href = 'login.jsp?jsessionid=08bd1aad6963961c7539fc4478a282a9';
    </script>
    </head>
    <body style="margin: 20px;">
    
    <h1>Welcome to H2</h1>
    <h2>No Javascript</h2>
    If you are not automatically redirected to the login page, then
    Javascript is currently disabled or your browser does not support Javascript.
    For this application to work, Javascript is essential.
    Please enable Javascript now, or use another web browser that supports it.
    
    </body></html>
    * Connection #0 to host 10.0.0.210 left intact
    [root@ip203 ~]# 
    复制代码
    • 测试不通过样例
    • [root@ip203 ~]# curl -v 10.0.0.210:8888
      * About to connect() to 10.0.0.210 port 8888 (#0)
      *   Trying 10.0.0.210...
      * 拒绝连接
      * Failed connect to 10.0.0.210:8888; 拒绝连接
      * Closing connection 0
      curl: (7) Failed connect to 10.0.0.210:8888; 拒绝连接
      [root@ip203 ~]# 

       

posted @   勤快的懒羊羊  阅读(88)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
历史上的今天:
2022-03-13 请求服务器报 504 Geteway Time-out
点击右上角即可分享
微信分享提示