netty - Netty 代理服务器正在返回由对等方重置的连接
问题描述
我克隆了 netty repo 并运行了代理示例
https://github.com/netty/netty/tree/4.1/example/src/main/java/io/netty/example/proxy
服务器启动良好。当我点击localhost:8443
浏览器时,出现以下错误
java.io.IOException: Connection reset by peer
at sun.nio.ch.FileDispatcherImpl.read0(Native Method)
at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39)
at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)
at sun.nio.ch.IOUtil.read(IOUtil.java:192)
at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:380)
at io.netty.buffer.PooledUnsafeDirectByteBuf.setBytes(PooledUnsafeDirectByteBuf.java:288)
at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1125)
at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:347)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:148)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:682)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:617)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:534)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:496)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:906)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.lang.Thread.run(Thread.java:748)
该示例是否已过时,还是我需要设置其他内容?
谢谢
解决方案
这基本上只是意味着远程对等方“强制”关闭了连接。没有什么可担心的,这在野外会经常发生。
推荐阅读
- linux - VScode 源代码控制在 Ubuntu 上失败
- python - 使用值准则迭代排列的最快方法
- javascript - 尝试声明主体类时可以使用“=”吗?
- artifactory - 如何使用 Artifactory 查询语言进行逆查询?
- javascript - 为什么我的 JS 的“点击事件”只运行一次?
- javascript - 当我以编程方式使用 form.submit()、form.requestSubmit(submitBtn) 或 submit.click() 时,没有触发另一个脚本 onclick 函数
- python - 尝试从文件播放声音时出现 Playsound 错误
- tensorflow - 在 tensorflow.keras 2.1 版本中保存渐变或显示渐变
- json - 如何防止 Svelte 在
标签?
- firebase - Flutter Firebase - 注册后无法导航到登录屏幕