Skip to content
This repository has been archived by the owner on Aug 11, 2023. It is now read-only.

cannot find http request method #9

Open
liziwei01 opened this issue Sep 9, 2022 · 2 comments
Open

cannot find http request method #9

liziwei01 opened this issue Sep 9, 2022 · 2 comments

Comments

@liziwei01
Copy link

liziwei01 commented Sep 9, 2022

美东从浏览器油猴脚本代理到中国大陆nginx,nginx监听443端口并转发所有请求到本地biliroaming服务的8123端口。biliroam监听8123端口

以上操作报错
nginx:

2022/09/10 00:39:29 [error] 10034#0: *638 SSL_do_handshake() failed (SSL: error:1408F10B:SSL routines:ssl3_get_record:wrong version number) while SSL handshaking to upstream, client: 50.203.132.35, server: www.api-liziwei01-me.work, request: "GET /pgc/player/web/playurl?avid=217589598&cid=818805339&qn=0&fnver=0&fnval=4048&fourk=1&ep_id=674708&session=033a2e24f7e610fbca1fea9bc7ca8761&from_client=BROWSER&drm_tech_type=3&module=bangumi&area=&access_key=ff7d85f8e2838c64d962741fdadf9491 HTTP/2.0", upstream: "https://127.0.0.1:8123/pgc/player/web/playurl?avid=217589598&cid=818805339&qn=0&fnver=0&fnval=4048&fourk=1&ep_id=674708&session=033a2e24f7e610fbca1fea9bc7ca8761&from_client=BROWSER&drm_tech_type=3&module=bangumi&area=&access_key=ff7d85f8e2838c64d962741fdadf9491", host: "www.api-liziwei01-me.work", referrer: "https://www.bilibili.com/bangumi/play/ep674708?from_spmid=666.19.0.0"

biliroaming:

2022/09/10 00:39:29 error when serving connection "127.0.0.1:8123"<->"127.0.0.1:49364": error when reading request headers: cannot find http request method in "\x16\x03\x01\x00\xbd\x01\x00\x00\xb9\x03\x03\x1c\xa5\t3ꑱ\x80\xe3.\xebA\x8e\xe8\x8b\xf6\\X\xcc\xd9R\xca\x18\xd4\xdel\xae5\x18\x89h\x91\x00\x008\xc0,\xc00\x00\x9f̨̩̪\xc0+\xc0/\x00\x9e\xc0$\xc0(\x00k\xc0#\xc0'\x00g\xc0\n\xc0\x14\x009\xc0\t\xc0\x13\x003\x00\x9d\x00\x9c\x00=\x00<\x005\x00/\x00\xff\x01\x00\x00X\x00\v\x00\x04\x03\x00\x01\x02\x00\n\x00\f\x00\n\x00\x1d\x00\x17\x00\x1e\x00\x19\x00\x18\x00#\x00\x00\x00\x16\x00\x00\x00\x17\x00\x00\x00\r\x000\x00.\x04\x03\x05\x03\x06\x03\b\a\b\b\b\t\b\n\b\v\b\x04\b\x05\b\x06\x04\x01\x05\x01\x06\x01\x03\x03\x02\x03\x03\x01\x02\x01\x03\x02\x02\x02\x04\x02\x05\x02\x06\x02". Buffer size=194, contents: "\x16\x03\x01\x00\xbd\x01\x00\x00\xb9\x03\x03\x1c\xa5\t3ꑱ\x80\xe3.\xebA\x8e\xe8\x8b\xf6\\X\xcc\xd9R\xca\x18\xd4\xdel\xae5\x18\x89h\x91\x00\x008\xc0,\xc00\x00\x9f̨̩̪\xc0+\xc0/\x00\x9e\xc0$\xc0(\x00k\xc0#\xc0'\x00g\xc0\n\xc0\x14\x009\xc0\t\xc0\x13\x003\x00\x9d\x00\x9c\x00=\x00<\x005\x00/\x00\xff\x01\x00\x00X\x00\v\x00\x04\x03\x00\x01\x02\x00\n\x00\f\x00\n\x00\x1d\x00\x17\x00\x1e\x00\x19\x00\x18\x00#\x00\x00\x00\x16\x00\x00\x00\x17\x00\x00\x00\r\x000\x00.\x04\x03\x05\x03\x06\x03\b\a\b\b\b\t\b\n\b\v\b\x04\b\x05\b\x06\x04\x01\x05\x01\x06\x01\x03\x03\x02\x03\x03\x01\x02\x01\x03\x02\x02\x02\x04\x02\x05\x02\x06\x02"

nginx反代配置:

user  root;
worker_processes  1;

events {
    worker_connections  1024;
}

http {
    include       mime.types;
    default_type  application/octet-stream;

    sendfile        on;
    keepalive_timeout  65;

    server
{
    server_name www.api-liziwei01-me.work;

    listen 443 ssl http2; 
     listen [::]:443 ssl http2;

    root /data/up1;
    client_max_body_size 128M;
    set_real_ip_from    173.245.48.0/20;
    set_real_ip_from    103.21.244.0/22;
    set_real_ip_from    103.22.200.0/22;
    set_real_ip_from    103.31.4.0/22;
    set_real_ip_from    141.101.64.0/18;
    set_real_ip_from    108.162.192.0/18;
    set_real_ip_from    190.93.240.0/20;
    set_real_ip_from    188.114.96.0/20;
    set_real_ip_from    197.234.240.0/22;
    set_real_ip_from    198.41.128.0/17;
    set_real_ip_from    162.158.0.0/15;
    set_real_ip_from    172.64.0.0/13;
    set_real_ip_from    131.0.72.0/22;
    set_real_ip_from    104.16.0.0/13;
    set_real_ip_from    104.24.0.0/14;
    # ipv6
    set_real_ip_from    2400:cb00::/32;
    set_real_ip_from    2606:4700::/32;
    set_real_ip_from    2803:f800::/32;
    set_real_ip_from    2405:b500::/32;
    set_real_ip_from    2405:8100::/32;
    set_real_ip_from    2a06:98c0::/29;
    set_real_ip_from    2c0f:f248::/32;

    real_ip_header CF-Connecting-IP;

    location / {
        proxy_pass https://127.0.0.1:8123; 
    }

    # RSA certificate
    ssl_certificate     /ssl/cert.pem;
    ssl_certificate_key /ssl/cert.key;
    ssl_protocols       TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers         HIGH:!aNULL:!MD5;
}

    include servers/*;
}

biliroaming配置:

# 调试模式
debug: false
# 监听端口
port: 8123

# 黑名单接口
blacklistApiUrl: "https://example.com/status.php?uid=%d"
# 黑白名单模式
# 0 - 禁用
# 1 - 黑白名单
# 2 - 白名单
blockType: 1

# 设置最低漫游版本,详情看哔哩漫游仓库 versionCode
roamingMinVer: 0

# 替换泰区 aid (评论投币)
thRedirect:
  aid: 0

# 各用户(uid)限制器
limiter:
  # 每秒请求限制
  limit: 2
  # 每秒突发求请求限制
  burst: 1

# 搜索限制器
searchLimiter:
  # 每秒请求限制
  limit: 1
  # 每秒突发求请求限制
  burst: 1

# 自定义搜索强制插入内容
customSearch:
  # 插入的 json 内容
  data: '{"title":"轉生成女性向遊戲只有毀滅 END 的壞人大小姐 X(僅限港澳台地區)","cover":"https://i0.hdslb.com/bfs/bangumi/image/0f96bfc98bbf5de38c8ba1516719231f3e9b69ff.png","uri":"https://www.bilibili.com/bangumi/play/ss39010/","param":"28234702","goto":"bangumi","ptime":1625241600,"season_id":39010,"season_type":1,"season_type_name":"番剧","media_type":1,"style":"小说改/穿越/搞笑/恋爱/少女","styles":"2021 | 番剧 | 日本","cv":"卡塔莉娜·克拉艾斯:內田真禮\n吉奧爾多·斯提亞特:蒼井翔太\n吉斯·克拉艾斯:柿原徹也\n亞蘭·斯提亞特:鈴木達央\n尼克爾·亞斯卡魯特:松岡禎丞\n梅麗·亨特:岡咲美保\n索菲亞·亞斯卡魯特:水瀨祈\n瑪麗亞·坎貝爾:早見沙織\n拉斐爾·沃爾特:增田俊樹\n安·謝利:和氣杏未\n傑佛瑞·斯提亞特:子安武人\n蘇珊娜·蘭德爾:上阪堇\n伊恩·斯提亞特:白井悠介\n賽琳娜·貝格:小倉唯\n魯弗斯·布羅德:鳥海浩輔","area":"日本","staff":"原作:山口悟(一迅社文庫IRIS/一迅社刊)\n角色原案:ひだかなみ\n監督:井上圭介\n系列構成:清水惠\n角色設計:大島美和\n道具設計:松永辰\n美術監督:込山明日香\n色彩設計:重富英里\n3D監督:栗林裕紀\n攝影監督:衛藤英毅\n編輯:瀧川三智(REAL-T)\n音響監督:龜山俊樹(grooove)\n音樂:田渕夏海、中村巴奈重、齋木達彥、櫻井美希、兼松眾、中島純子、青木沙也果、佐久間奏\n音樂製作:日音\n動畫製作:SILVER LINK.","is_selection":1,"badge":"番剧","episodes":[{"position":1,"uri":"https://www.bilibili.com/bangumi/play/ep408600","param":"408600","index":"1"},{"position":2,"uri":"https://www.bilibili.com/bangumi/play/ep408601","param":"408601","index":"2"},{"position":3,"uri":"https://www.bilibili.com/bangumi/play/ep408602","param":"408602","index":"3"},{"position":4,"uri":"https://www.bilibili.com/bangumi/play/ep408603","param":"408603","index":"4"},{"position":5,"uri":"https://www.bilibili.com/bangumi/play/ep408604","param":"408604","index":"5"},{"position":6,"uri":"https://www.bilibili.com/bangumi/play/ep408605","param":"408605","index":"6"},{"position":7,"uri":"https://www.bilibili.com/bangumi/play/ep408606","param":"408606","index":"7"},{"position":8,"uri":"https://www.bilibili.com/bangumi/play/ep408607","param":"408607","index":"8"},{"position":9,"uri":"https://www.bilibili.com/bangumi/play/ep408608","param":"408608","index":"9"},{"position":10,"uri":"https://www.bilibili.com/bangumi/play/ep408609","param":"408609","index":"10"},{"position":11,"uri":"https://www.bilibili.com/bangumi/play/ep408610","param":"408610","index":"11"},{"position":12,"uri":"https://www.bilibili.com/bangumi/play/ep408611","param":"408611","index":"12"}],"label":"小说改/穿越/搞笑/恋爱/少女","watch_button":{"title":"立即观看","link":"https://www.bilibili.com/bangumi/play/ss39010"},"follow_button":{"icon":"http://i0.hdslb.com/bfs/bangumi/154b6898d2b2c20c21ccef9e41fcf809b518ebb4.png","texts":{"0":"追番","1":"已追番"},"status_report":"bangumi"},"selection_style":"grid","episodes_new":[{"title":"1","uri":"https://www.bilibili.com/bangumi/play/ep408600","param":"408600","is_new":0,"position":1},{"title":"2","uri":"https://www.bilibili.com/bangumi/play/ep408601","param":"408601","is_new":0,"position":2},{"title":"...","uri":"bilibili://search/bangumi-episodes/grid/39010","param":"0","is_new":0,"type":1},{"title":"10","uri":"https://www.bilibili.com/bangumi/play/ep408609","param":"408609","is_new":0,"position":3},{"title":"11","uri":"https://www.bilibili.com/bangumi/play/ep408610","param":"408610","is_new":0,"position":4},{"title":"12","uri":"https://www.bilibili.com/bangumi/play/ep408611","param":"408611","is_new":0,"position":5}],"is_atten":1}'
  # 插入的 json 内容
  webData: '{"type":"media_bangumi","media_id":28235221,"title":"世界頂尖的暗殺者\u003cem class=\"keyword\"\u003e轉生\u003c/em\u003e為異世界貴族(僅限港澳台地區)","org_title":"世界最高の暗殺者、異世界貴族に転生する","media_type":1,"cv":"盧各:赤羽根健治\n蒂亞:上田麗奈\n塔兒朵:高田憂希\n瑪荷:下地紫野\n","staff":"原作:月夜淚( Sneaker文庫 KADOKAWA刊)\n角色原案:れい亜\n監督:田村正文\n系列構成、腳本:高山克彥\n角色設計:長田繪裡\n總作畫監督:吉川佳織\n設計輔佐:藤井亞裡莎\n武器設計:氏家嘉宏\n道具設計:今田茜\n美術監督、美術設定:吉山裕也\n美術助理:內山明日香\n色彩設計:吉田隼人\n攝影監督:新穀優子\n圖形設計:柏原進\n3D導演:江田惠一\n編輯:瀧川三智\n音響監督:土屋雅紀\n音響效果:川田清貴\n音響製作:Glovision\n音樂:黑田賢一\n音樂製作:Lantis\n動畫製作:SILVER LINK.×studio palette\n","season_id":39528,"is_avid":false,"hit_columns":["title"],"hit_epids":"","season_type":1,"season_type_name":"番剧","selection_style":"grid","ep_size":12,"url":"https://www.bilibili.com/bangumi/play/ss39528","button_text":"立即观看","is_follow":0,"is_selection":1,"eps":[{"id":425279,"cover":"http://i0.hdslb.com/bfs/archive/c6dba6068b7400909920df6df0fb6391c5dd7a77.png","title":"1","url":"https://www.bilibili.com/bangumi/play/ep425279","release_date":"","badges":null,"index_title":"1","long_title":"信任的報償"},{"id":425317,"cover":"http://i0.hdslb.com/bfs/archive/2d1d4ffb3c1cde990f1ef7b9b61228bdf2d2a296.png","title":"2","url":"https://www.bilibili.com/bangumi/play/ep425317","release_date":"","badges":null,"index_title":"2","long_title":"轉生的交易"},{"id":425318,"cover":"http://i0.hdslb.com/bfs/archive/86d2d889773d3b990b8c5d70f59fa51cf063d23b.png","title":"3","url":"https://www.bilibili.com/bangumi/play/ep425318","release_date":"","badges":null,"index_title":"3","long_title":"友誼的魔法"},{"id":425319,"cover":"http://i0.hdslb.com/bfs/archive/73425afdfbca1e3e0e9ed1571335abfb253365b4.png","title":"4","url":"https://www.bilibili.com/bangumi/play/ep425319","release_date":"","badges":null,"index_title":"4","long_title":"女神的計劃"},{"id":425320,"cover":"http://i0.hdslb.com/bfs/archive/f26b5ba9c710fccc7ac104144e902d7962f32643.png","title":"5","url":"https://www.bilibili.com/bangumi/play/ep425320","release_date":"","badges":null,"index_title":"5","long_title":"暗殺者的資格"},{"id":425321,"cover":"http://i0.hdslb.com/bfs/archive/7f80ef0130496828c0f8deb9d267fcde64be6337.png","title":"6","url":"https://www.bilibili.com/bangumi/play/ep425321","release_date":"","badges":null,"index_title":"6","long_title":"少女之家"},{"id":425322,"cover":"http://i0.hdslb.com/bfs/archive/4d65ec20d0feb497fd558df79a2f4ec223625bcd.png","title":"7","url":"https://www.bilibili.com/bangumi/play/ep425322","release_date":"","badges":null,"index_title":"7","long_title":"虛假的生活"},{"id":425323,"cover":"http://i0.hdslb.com/bfs/archive/f5bc415d22ac506559ee444e4778ae54b62b41ab.png","title":"8","url":"https://www.bilibili.com/bangumi/play/ep425323","release_date":"","badges":null,"index_title":"8","long_title":"選擇的儀式"},{"id":425324,"cover":"http://i0.hdslb.com/bfs/archive/85bcde25840625b61180fb22087441df406280f0.png","title":"9","url":"https://www.bilibili.com/bangumi/play/ep425324","release_date":"","badges":null,"index_title":"9","long_title":"暗殺的代價"},{"id":425325,"cover":"http://i0.hdslb.com/bfs/archive/e47f1240e5b276fe353bc1b55da2ec5b8cdd2b68.png","title":"10","url":"https://www.bilibili.com/bangumi/play/ep425325","release_date":"","badges":null,"index_title":"10","long_title":"初次約會"},{"id":425326,"cover":"http://i0.hdslb.com/bfs/archive/9bacd9538974ff812826a85a42d93ee19fe6256b.png","title":"11","url":"https://www.bilibili.com/bangumi/play/ep425326","release_date":"","badges":null,"index_title":"11","long_title":"背叛的决定"},{"id":425327,"cover":"http://i0.hdslb.com/bfs/archive/02128b4622b0513d5ac02ae757d3e74d03dd633c.png","title":"12","url":"https://www.bilibili.com/bangumi/play/ep425327","release_date":"","badges":null,"index_title":"12","long_title":"暗殺者的戰鬥"}],"badges":null,"cover":"http://i0.hdslb.com/bfs/bangumi/image/0d6306a74b6a941f187359ef646e3c65be31f749.jpg","areas":"日本","styles":"小说改/穿越/战斗","goto_url":"https://www.bilibili.com/bangumi/play/ss39528","desc":"世界第一的暗殺者,作為暗殺世家的長男重生了。\n作為能夠轉生到異世界的條件,他接下了女神給下達的唯一一項任務。\n\n“殺了被預言會帶給人類災厄的‘勇者’”。\n\n這是曾經世界最強暗殺者在新的人生中必須要完成...","pubtime":1633017600,"media_mode":2,"fix_pubtime_str":"","media_score":{"score":0,"user_count":0},"display_info":null,"pgc_season_id":39528,"corner":2}'

# 自定义插入字幕
customSubtitle:
  apiUrl: "https://example.com/path?season_id=%d"
  teamName: "蒙古上单字幕组"

# 缓存时间
# 实例:"1h1m4s" / "5m1s" / "4s"
cache:
  # 用户 key
  accessKey: 168h
  # 用户资料(uid 和 大会员状态)
  user: 168h
  # 播放链接
  playUrl: 15m
  # 泰区 season
  thSeason: 15m
  # 泰区字幕(兼容老版本)
  thSubtitle: 15m

# 代理
proxy:
  cn: socks5://127.0.0.1:7890
  hk: socks5://127.0.0.1:7891
  tw: socks5://127.0.0.1:7892
  th: socks5://127.0.0.1:7893

# 反代域名
reverse:
  cn: api.bilibili.com
  hk: api.bilibili.com
  tw: api.bilibili.com
  th: app.biliintl.com

# 反代搜索域名
reverseSearch:
  cn: app.bilibili.com
  hk: app.bilibili.com
  tw: app.bilibili.com
  th: api.biliintl.com

# 反代网页搜索域名
reverseWebSearch:
  cn: api.bilibili.com
  hk: api.bilibili.com
  tw: api.bilibili.com

# 鉴权 + 缓存
auth:
  cn: true
  hk: true
  tw: true
  th: true

# 数据库
postgreSQL:
  host: "localhost"
  user: "postgres"
  password: 'postgres'
  # passwordFile: "/run/secrets/db-password"
  dbName: "postgres"
  port: 5432

切换nginx设置

real_ip_header CF-Connecting-IP;

real_ip_header X-Forwarded-For;

报错一致

@cxw620
Copy link

cxw620 commented Sep 9, 2022

注释掉image看看

顺便把image改为0, image注释掉

这是Nginx配置问题, 跟这项目没关系吧😓

@AisukaYuki
Copy link

AisukaYuki commented Sep 23, 2022

location / {
proxy_pass https://127.0.0.1:8123; (为什么要https。。。go server端又没有配置ssl,反代之后让nginx去套证书就行了)
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants