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

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

使用 curl 测试连接

  • 测试通过样例
[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 ~]# 

 
 
 
 
 

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值