Giter Club home page Giter Club logo

Comments (6)

a08381 avatar a08381 commented on June 16, 2024 2

I have 0 knowledge of kotlin language. Did a quick search through out the source repository and found this function definition:

https://github.com/ktorio/ktor/blob/master/ktor-client/ktor-client-core/common/src/io/ktor/client/features/websocket/builders.kt#L133

Seeing we are using the following API when establishing the websocket session:

https://github.com/yyuueexxiinngg/cqhttp-mirai/blob/master/src/main/kotlin/tech/mihoyo/mirai/web/websocket/WebsocketReverseClient.kt#L91

Wondering whether this could be the culprit?

这么看起来的话,差不多就是我之前提的给ws反向连接添加一个tls_enabled配置就可以了

from onebot-kotlin.

Hugozys avatar Hugozys commented on June 16, 2024 1

I have 0 knowledge of kotlin language. Did a quick search through out the source repository and found this function definition:
https://github.com/ktorio/ktor/blob/master/ktor-client/ktor-client-core/common/src/io/ktor/client/features/websocket/builders.kt#L133

Seeing we are using the following API when establishing the websocket session:
https://github.com/yyuueexxiinngg/cqhttp-mirai/blob/master/src/main/kotlin/tech/mihoyo/mirai/web/websocket/WebsocketReverseClient.kt#L91

Wondering whether this could be the culprit?

from onebot-kotlin.

yyuueexxiinngg avatar yyuueexxiinngg commented on June 16, 2024 1

已在新版中添加支持 .如有BUG请reopen

from onebot-kotlin.

b11p avatar b11p commented on June 16, 2024

502 Bad Gateway的话,是不是你反代没配置好?

from onebot-kotlin.

a08381 avatar a08381 commented on June 16, 2024

502 Bad Gateway的话,是不是你反代没配置好?

反向代理的配置我感觉是没有问题的

配置如下

#PROXY-START/
location /
{
    expires 12h;
    if ($request_uri ~* "(php|jsp|cgi|asp|aspx)")
    {
         expires 0;
    }
    proxy_pass http://127.0.0.1:8002;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header REMOTE-HOST $remote_addr;
    
    #持久化连接相关配置
    proxy_connect_timeout 30s;
    proxy_read_timeout 86400s;
    proxy_send_timeout 30s;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    add_header X-Cache $upstream_cache_status;
	#Set Nginx Cache

    proxy_ignore_headers Set-Cookie Cache-Control expires;
    proxy_cache cache_one;
    proxy_cache_key $host$uri$is_args$args;
    proxy_cache_valid 200 304 301 302 1m;
}

#PROXY-END/

from onebot-kotlin.

Hugozys avatar Hugozys commented on June 16, 2024

你好,我遇到了相同的问题,以下是我的反代配置:

upstream backend{
    server localhost:8080;	      
}
server
{
    server_name subdomain.tld;
    charset UTF-8;
    access_log      /var/log/nginx/uWSGI_access.log;
    error_log       /var/log/nginx/uWSGI_error.log;
	      
    client_max_body_size 75M;
    location / { 
	proxy_pass http://backend;
        proxy_redirect off;
        proxy_http_version 1.1;
        proxy_buffering off;
        proxy_connect_timeout 30s; 
        proxy_read_timeout 600s; 
        proxy_send_timeout 30s; 
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }   
    location /static {
        expires 30d;
        autoindex on; 
        add_header Cache-Control private;
        alias /home/ubuntu/project/static;
    }


    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/subdomain.tld/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/subdomain.tld/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}
server
{
    if ($host = subdomain.tld) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


    server_name subdomain.tld;
    listen 80;
    return 404; # managed by Certbot
}

将反向WebSocket 端口 更改成443 之后遇到了与 @a08381 相同的错误

from onebot-kotlin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.