-
Notifications
You must be signed in to change notification settings - Fork 12
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
Connection Refused to WebSocket Server #2
Comments
Change 127.0.0.1 to external host name. |
After I replaced 127.0.0.1 with the external address of my server, it didn't display an error, but at the same time I opened two browser windows and danmu still didn't show up. |
Trying to rebuild a server and reinstall it, it is still unusable. Is it due to the update of Dplayer version? |
I don't know if you still care about this problem, but I solved it. There are a few things that need to be modified. First, the var hexColorRegExp = /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/;
var typeRegExp =/^(top|bottom|right)$/;
//// change these two variables to the following form, because the message format of dplayer has changed. ////
var hexColorRegExp = /^\d{8}$/
var typeRegExp = /^(0|1|2)$/; If you use your domain by map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server
{
...
server_name your.domain;
root /path/to/index.html;
location / {
index index.html index.htm;
}
location /websocket {
proxy_pass http://127.0.0.1:port;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
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 X-Forwarded-Proto $scheme;
proxy_pass_request_headers on;
}
...
} Then, change your apiBackend: createApiBackend('ws://localhost:1207', function (dan) {
<!-- change the url to the following form, if https, ws->wss, if not, keep ws. -->
apiBackend: createApiBackend('wss://your.domain/websocket', function (dan) { Hope this can help you. |
I installed the background as described in the readme, but the player returned the following:
Connection with 'ws://127.0.0.1:1207 /' WebSocket failed: connection establishment error: net :: ERR_CONNECTION_REFUSED
The following code has an error:
I am sure that server.js is running on the server before accessing the player (according to readme):
The "danmuku" folder belongs to root:root and the permissions are 755.
If you wish to view my test page, this is the link: live.kerbcat.com
Hope to get help as soon as possible, thank you.
The text was updated successfully, but these errors were encountered: