WebSocket connection to 'ws://server-ip:port-name/ws' failed: Error during WebSocket handshake: Invalid status line on tsip_transport.js?svn=241:359
While trying to connect to PBX server on
http://server-ip/call.htm on my server same to which is present on official site below
https://www.doubango.org/sipml5/call.htm
I get the above error.
The code which gives me the error is
var s_url = tsk_string_is_null_or_empty(o_self.o_stack.network.s_websocket_server_url) ?
tsk_string_format("{0}://{1}:{2}",o_self.s_protocol, o_self.s_host, o_self.i_port) : o_self.o_stack.network.s_websocket_server_url;
tsk_utils_log_info("Connecting to '"+s_url+"'");
o_self.o_ws = new WebSocket(s_url, 'sip');
I am getting an error on this line
o_self.o_ws = new WebSocket(s_url, 'sip');
A WebSocket client expects that a WebSocket server returns 101 as the HTTP status code (see RFC 6455 for details). Check what HTTP status code your WebSocket server returns. It will give you a hint.
Related
I am receiving the below error while connecting the FTP path for file transfer through
Mulesoft code and it is worked for so many days, unfortunately, we received this error from a
couple of dys. So please help me to fix this.
Error
Message: An exception was found trying to obtain a connection: Found exception trying to change transfer mode to class org.mule.extension.ftp.api.ftp.FtpTransferMode. FTP reply code is: 421
Element : ac-ngwtransform-ftp-v1Flow/processors/6/processors/0/route/0/processors/1 # azx-us-int-ac-ngwtransform-ftp-v1:ac-ngwtransform-ftp-v1.xml:84 (Reading the file from FTP)
Element XML : <ftp:read doc:name="Reading the file from FTP" doc:id="da9be7af-d84b-4a78-a8ce-cd9f117aa273" config-ref="FTP_Config_NGW" path="#[attributes.fileName]" outputMimeType="text/plain"></ftp:read>
Error type : FTP:CONNECTIVITY
Payload Type : org.mule.runtime.core.internal.streaming.bytes.ManagedCursorStreamProvider
--------------------------------------------------------------------------------
Root Exception stack trace:
org.apache.commons.net.ftp.FTPConnectionClosedException: FTP response 421 received.
you can use reconnection strategy to fix this issue.
go to your ftp connector-->advance->click reconnection and make the reconnection strategy standard.
1) In the first time, when I deployed the origin code to heroku server with git clone https://github.com/cleverbeagle/pup
The launching application didn't work.
I managed to correct this with to copy the content of 'settings-development.json' file and paste in Heroku => myProject => Setttings => Reveal Config Vars => Key : METEOR_SETTINGS and Value : I pasted here the content.
thanks to :
- https://github.com/cleverbeagle/pup/issues/9
- https://github.com/cleverbeagle/pup/issues/197
So, now, the app is showing on server.
2) On Chrome console, I have this error :
50d72c91808ef7fba57f920b67d152d2d57698eb.js?meteor_js_resource=true:9 WebSocket connection to 'ws://localhost:4001/graphql' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED
so I changed this in METEOR_SETTINGS
"graphQL": {
"httpUri": "http://localhost:3000/graphql",
"wsUri": "ws://localhost:4001/graphql"
},
to
"graphQL": {
"httpUri": "https://myproject.herokuapp.com:3000/graphql",
"wsUri": "wss://myproject.herokuapp.com:4001/graphql"
},
Note without https and wss, the app is not showing
3) Now on Chrome Console, I have :
this warning :
50d72c91808ef7fba57f920b67d152d2d57698eb.js?meteor_js_resource=true:9 WebSocket connection to 'wss://myproject.herokuapp.com:4001/graphql' failed: WebSocket is closed before the connection is established.
and after several warning above, I have this error :
50d72c91808ef7fba57f920b67d152d2d57698eb.js?meteor_js_resource=true:9 WebSocket connection to 'wss://myproject.herokuapp.com:4001/graphql' failed: WebSocket opening handshake timed out
By using the origin source code from Pup, I can signup on server but I cannot create a new document.
Any help, please ?
Thank you
EDIT 15 JAN 2019
**4) I remove Port like this : **
"httpUri": "https://myproject.herokuapp.com/graphql",
"wsUri": "wss://myproject.herokuapp.com/graphql"
Now, I can create New document on https://myproject.herokuapp.com/documents
but I still have this warning :
fe6fa1ac83e19aa2513ac3f97293600e8dc99e8e.js?meteor_js_resource=true:9
WebSocket connection to 'wss://myproject.herokuapp.com/graphql'
failed: WebSocket is closed before the connection is established.
and this error :
WebSocket connection to 'wss://myproject.herokuapp.com/graphql'
failed: Error during WebSocket handshake: Unexpected response code:
503
any idea ?
Thanks
I looked at many other similar questions, but none seem to work for me.
I am following this example: http://www.devglan.com/spring-boot/spring-websocket-integration-example-without-stomp
When, I tried this example alone, it is working perfectly. However, when I tried to integrate it with my main project, it seems to be giving the error: WebSocket connection to 'ws://localhost:8080/socket' failed: Error during WebSocket handshake: Unexpected response code: 404
I am just calling index.html directly in my main project.
I am unable to find the source of error.
Following are all the jars in my main project where error is generated:
classmate-1.3.3.jar
commons-io-1.3.2.jar
commons-net-3.6.jar
groovy-2.4.10.jar
hibernate-validator-5.3.5.Final.jar
jackson-annotations-2.8.0.jar
jackson-core-2.8.8.jar
jackson-databind-2.8.8.jar
javassist-3.21.0-GA.jar
jboss-logging-3.3.1.Final.jar
jcl-over-slf4j-1.7.25.jar
json-20140107.jar
jul-to-slf4j-1.7.25.jar
log4j-over-slf4j-1.7.25.jar
logback-classic-1.1.11.jar
logback-core-1.1.11.jar
ognl-3.0.8.jar
slf4j-api-1.7.25.jar
snakeyaml-1.17.jar
spring-aop-4.3.8.RELEASE.jar
spring-beans-4.3.8.RELEASE.jar
spring-boot-1.5.3.RELEASE.jar
spring-boot-autoconfigure-1.5.3.RELEASE.jar
spring-boot-devtools-1.5.3.RELEASE.jar
spring-boot-starter-1.5.3.RELEASE.jar
spring-boot-starter-logging-1.5.3.RELEASE.jar
spring-boot-starter-thymeleaf-1.5.3.RELEASE.jar
spring-boot-starter-tomcat-1.5.3.RELEASE.jar
spring-boot-starter-web-1.5.3.RELEASE.jar
spring-boot-starter-websocket-1.5.3.RELEASE.jar
spring-context-4.3.8.RELEASE.jar
spring-core-4.3.8.RELEASE.jar
spring-expression-4.3.8.RELEASE.jar
spring-messaging-4.3.8.RELEASE.jar
spring-web-4.3.8.RELEASE.jar
spring-webmvc-4.3.8.RELEASE.jar
spring-websocket-4.3.8.RELEASE.jar
thymeleaf-2.1.5.RELEASE.jar
thymeleaf-layout-dialect-1.4.0.jar
thymeleaf-spring4-2.1.5.RELEASE.jar
tomcat-embed-core-8.5.14.jar
tomcat-embed-el-8.5.14.jar
tomcat-embed-websocket-8.5.14.jar
unbescape-1.1.0.RELEASE.jar
validation-api-1.1.0.Final.jar
I am trying to make a HTTP request using Capybara. When I attempt to execute the code below:
Net::HTTP.get_response(uri)
I get an error:
Errno::ECONNREFUSED: Connection refused - connect(2)
When I try the URI passed into the method explicitly it works perfectly. URL is an absolute address to the localhost starting with http://.
I don't know what I am doing wrong.
I want to create a http2 server using node-http2 module without TLS. My code is as follows:
http2 = require('http2');
const bunyan = require('bunyan');
var log = bunyan.createLogger({name: "HTTP2 server without TLS!"});
var options = {
log: log
}
var server = http2.raw.createServer(options, function(request, response) {
console.log("Receiving HTTP2 request!");
// response.writeHead(200);
response.end('Hello world from HTTP2!');
});
server.listen(8000);
However, it does not work. When connecting to this server from chrome, it shows downloading something. When I closed the server, the downloading is finished with blank file (26 bytes).
Does anyone know what is wrong here? Do I need to configure the browser? Thanks in advance!
Chrome and all other browsers only support HTTP/2 over TLS (h2) and not plain HTTP/2 (h2c). So your browser does not understand what is returned from the server and apparently node-http2 does not send a proper error response when it receives a non-http2 request.
The problem seems not just from the browser. Using [curl] curllink that supports http2 over an http:// URL does not working either. Following is the output from the curl:
$ curl -I --http2 http://54.208.83.136:8000/ -v -k
* Trying 54.208.83.136...
* Connected to 54.208.83.136 (54.208.83.136) port 8000 (#0)
> HEAD / HTTP/1.1
> Host: 54.208.83.136:8000
> User-Agent: curl/7.47.1
> Accept: */*
> Connection: Upgrade, HTTP2-Settings
> Upgrade: h2c
> HTTP2-Settings: AAMAAABkAAQAAP__
>
As we see from the curl output. It sends http/1.1 Upgrade request with proper headers set as it supposed to do according to the [http2 rfc] rfclink.
On the server side, the logs were very long, so I present here only the content of msg in the relevant three logs.
New incoming HTTP/2 connection
Client connection header prelude does not match
PROTOCOL ERROR, Fatal error, closing connection
So basically the server closed the connection because the client connection header prelude does not match. By checking the code, I figured out the error was originated from the readPrelude function of [endpoint.js] endpointlink. It is a function to read the client header, but I don't know what is wrong in the client header :(.
Thus maybe I can say the node-http2 module does not support http2 over plaintext.
Update: it turns out that I was wrong. The node-http2 module do support http2 over plaintext with direct connecting, it does not support HTTP/2 server with Upgrade from HTTP/1.1. The problem resulted from the client side using Upgrade mechanism to connect to the server not supporting Upgrade. Using nghttp client to connect sever with prior knowledge works as follows.
$ nghttp http://127.0.0.1:8000/
Hello world from HTTP2!
nghttpd server also supports HTTP2 without TLS, even though it does not support HTTP Upgrade.
$ nghttpd -d /Documents/Proxy 8080 --no-tls -v
So I highly suggest to use nghttp when you want to test HTTP2 without TLS.