Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用nginx进行websocket反向代理会抛错 #8

Open
chigco opened this issue Sep 27, 2018 · 2 comments
Open

使用nginx进行websocket反向代理会抛错 #8

chigco opened this issue Sep 27, 2018 · 2 comments

Comments

@chigco
Copy link

chigco commented Sep 27, 2018

[:01000011] lua call [0 to :1000011 : 0 msgsz = 24] error : �[31m./skynet/lualib/skynet.lua:526: ./skynet/lualib/skynet.lua:156: ./skynet/lualib/skynet/socket.lua:253: assertion failed!
stack traceback:
[C]: in upvalue 'assert'
./skynet/lualib/skynet/socket.lua:253: in function 'skynet.socket.read'
(...tail calls...)
./build/lualib/websocket.lua:236: in function 'websocket.recv_frame'
./build/lualib/websocket.lua:212: in function 'websocket.recv'
./build/lualib/websocket.lua:341: in function 'websocket.start'
./service/wsgate/main.lua:57: in upvalue 'handle_socket'
./service/wsgate/main.lua:88: in field 'callback'
./skynet/lualib/skynet/socket.lua:105: in field '?'
./skynet/lualib/skynet/socket.lua:161: in upvalue 'f'
./skynet/lualib/skynet.lua:111: in function <./skynet/lualib/skynet.lua:105>
stack traceback:
[C]: in upvalue 'assert'
./skynet/lualib/skynet.lua:526: in function 'skynet.dispatch_message'�[0m

@h87070628
Copy link

local function accept_connection(header, check_origin, check_origin_ok)
dump( header, "YYYYYY", 9)

-- Upgrade header should be present and should be equal to WebSocket
if not header["upgrade"] or header["upgrade"]:lower() ~= "websocket" then
    return 400, "Can \"Upgrade\" only to \"WebSocket\"."
end

@h87070628
Copy link

应该是这里出问题了, nginx代理过来以后, 头没有upgrade

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

No branches or pull requests

2 participants