请帮我解释一下这个报错是怎么回事tunneling socket could not be established, cause=connect ECONNREFUSED 127.0.0.1:80
时间: 2023-06-02 20:06:02 浏览: 222
这个报错通常是由于在试图建立 HTTP 连接时无法建立本地主机与目标主机之间的隧道导致的。具体原因可能是因为目标主机在该端口上没有运行 HTTP 服务器,或者因为本地主机的防火墙阻止了与目标主机的连接。
相关问题
Connecting to 127.0.0.1:19090... connected. Proxy tunneling failed: Method Not AllowedUnable to establish SSL connection.
As an AI language model, I am not able to troubleshoot your specific issue without further context. However, this error message suggests that there may be an issue with your proxy settings or SSL certificate.
You may want to try the following steps:
1. Check your proxy settings and make sure they are correct.
2. Verify that the SSL certificate is valid and has not expired.
3. Try connecting to the server using a different port or protocol (e.g., HTTP instead of HTTPS).
4. If the issue persists, contact your network administrator or the server administrator for further assistance.
http://127.0.0.1:23118/
### 如何在 localhost 的 23118 端口上运行服务
要在 `localhost` 上启动并运行一个服务于特定端口(如 23118),可以通过以下方法实现:
#### 使用 Python 启动 HTTP 服务器
Python 提供了一个简单的内置模块来快速创建 HTTP 服务器。以下是具体操作:
```bash
python3 -m http.server 23118
```
此命令将在指定的端口(此处为 23118)上启动一个基本的 HTTP 服务器[^2]。
如果需要验证服务是否正常工作,可以在浏览器中输入 `http://localhost:23118` 或者使用工具如 `curl` 进行请求测试:
```bash
curl http://localhost:23118
```
#### 配置 Nuxt.js 应用程序监听特定端口
对于基于 Nuxt.js 的项目,可以通过调整配置文件中的参数来自定义运行端口。编辑项目的 `nuxt.config.js` 文件,在其中添加或修改如下内容:
```javascript
export default {
server: {
port: 23118, // 设置目标端口号
host: '0.0.0.0' // 可选,默认绑定到 localhost (即 127.0.0.1),设置为 '0.0.0.0' 则允许外部访问
}
}
```
保存后重新启动开发环境即可让应用运行在指定端口上[^3]。
#### 查看 MySQL 是否正在使用默认端口 3306 并确认其状态
为了确保数据库实例确实是在标准 SQL 端口(通常是 3306)下运作,可采用 netstat 工具扫描开放端口中是否存在匹配项:
```bash
sudo netstat -tulnp | grep mysql
```
上述指令会显示所有由 mysqld 占有的网络连接详情;如果没有发现任何记录,则说明当前系统上的 MySQL 数据库并未处于活动状态或者未被设定成对外提供服务模式[^1]。
另一种更为直观的办法就是直接查询内部变量值:
```sql
SHOW VARIABLES WHERE Variable_name = 'port';
```
这句 SQL 将返回实际使用的通信接口编号。
#### SSH 隧道转发远程桌面至本地端口映射案例分析
当涉及到跨机器间的资源分享时,SSH Tunneling 成为了不可或缺的技术手段之一。比如下面这个例子展示了怎样把远端服务器上的某个 web service 映射回自己 PC 的任意可用位置上去:
```bash
ssh -L 23118:127.0.0.1:7860 username@remote_server_ip
```
完成之后只要简单地造访 `http://localhost:23118` 就能体验原本部署在外网之下的功能特性了[^4]。
阅读全文
相关推荐












