V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
VKRUSSIA
V2EX  ›  Java

tomcat9 写的 websocket 服务端在本机和局域网连接正常,放外网死活 404

  •  
  •   VKRUSSIA · Jan 14, 2021 · 2374 views
    This topic created in 1932 days ago, the information mentioned may be changed or developed.

    浪费几天时间还没解决,stackoverflow 翻遍了大部分是说依赖冲突的 难道 tomcat9 的 websocket 不支持联网?

    7 replies    2021-02-22 16:23:58 +08:00
    wysnylc
        1
    wysnylc  
       Jan 14, 2021
    互联网就是个大点的局域网
    Jirajine
        2
    Jirajine  
       Jan 14, 2021 via Android
    盲猜 Host 问题,检查 web 服务器绑定的主机名。
    Joyuce
        3
    Joyuce  
       Jan 15, 2021
    nginx 配置了吗?云服务商解析也需要配置
    VKRUSSIA
        4
    VKRUSSIA  
    OP
       Jan 15, 2021
    忘了说,我是用 frp 内网穿透部署于 termux 里的 tomcat,我用外网服务器试了下正常,但是用 frp 内网映射就不行。

    我查看 catalina.out 日志发现能触发 onOpen

    但是报 java.io.EOFException 异常(错误代码 1006 )

    大佬们帮我康康 frp 配置有没有什么问题:
    frps.ini
    [common]
    bind_port = 7000
    log_file = ./frps.log
    log_level = info
    log_max_days = 3
    vhost_http_port = 8080
    ----------------------------
    frpc.ini
    [common]
    server_addr = 公网服务器 ip
    server_port = 7000

    [web]
    type = http
    local_ip = 127.0.0.1
    local_port = 8080
    custom_domains = 公网服务器 ip
    remote_port = 8080

    [websocket]
    type = tcp
    local_ip = 127.0.0.1
    local_port = 80 [不知道 tomcat 里的 websocket 端口是多少谷歌了下说是 80]
    use_encryption = false
    use_compression = false
    custom_domains = 公网服务器 ip
    remote_port = 4567 [这里也不确定该填什么端口]
    VKRUSSIA
        5
    VKRUSSIA  
    OP
       Jan 15, 2021
    @Jirajine 大佬帮我看看 4 楼的 frp 配置有没有问题
    VKRUSSIA
        6
    VKRUSSIA  
    OP
       Jan 15, 2021
    @Joyuce 大佬帮我康康 4 楼的 frp 配置有没有问题
    V2Axiu
        7
    V2Axiu  
       Feb 22, 2021
    看看是不是堡垒机有安全策略 将请求头变更了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2510 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 54ms · UTC 09:35 · PVG 17:35 · LAX 02:35 · JFK 05:35
    ♥ Do have faith in what you're doing.