Could not connect to Twilio: Signaling connection error - google-chrome

I am trying to make the connection between chrome (v - 67) and chrome (v- 79), at the time got the error like:
WebSocket connection to 'wss://global.vss.twilio.com/signaling' failed: Error in connection establishment: net:: ERR_SOCKS_CONNECTION_FAILED
I have attached the video link here. please check out and let me help out for this.
Chrome (v-79) : connection is successfully.
check below url- https://drive.google.com/file/d/1aVsRhDEmp7q1atAwMcbh9L_bPv-iiqNA/view
Chrome(v-67): Could not connect to Twilio: Signaling connection error
check URL: https://drive.google.com/file/d/1TbGaJ_aSyfswTGOXA-8Sw1u_s_skBH-C/view
I have added below option in connectOptions
const connectOptions = {
_useTwilioConnection: true
};
But I have faced the same issue. I have created an Http tunnel. So, If you want to check this feature using my end.
please hit this link: https://b256e195.ngrok.io
Code to reproduce the issue:
Video.connect(data.token, connectOptions).then(roomJoined, function (error) {
alert("Video connect error part");
console.log(error);
log('Could not connect to Twilio: ' + error.message);
});
Expected behavior:
I need to work on both sides.
Actual behavior:
The connection could not establish in chrome (v-67)
Software versions:
[x] Browser(s): Chrome(v-79), Chrome(v-67) (not working), Chrome(v-75) (not working)
[x] Operating System: window 10
[x] twilio-video.js: we have migrate from 1.x to 2.x
[x] Third-party libraries (e.g., Angular, React, etc.): Angular js

Related

Can't connect to MySQL in Sails with PlanetHoster server

After two weeks of trying to run my site, I'm asking for your help.
Has anyone hosted Sails.JS on PlanetHoster?
My queries don't work because the connection to the database doesn't seem established.
Here's an example of some very simple queries:
await User.findOne({ email: email });
Here's what's displayed in the browser error console:
Uncaught (in promise) Error: Request failed with status code 500
I've tried to handle the errors but nothing is displayed...
try { await User.findOne({ email: email }); } catch(err) { // nothing }
So I've deduced that it was a problem with calling the database.
Unfortunately, I have no way to read the error logs ...
Yet, I've set the production.js file (config/env/production.js) and when I run NODE_ENV = production node app.js, it's still displayed in development. In fact, PlanetHoster doesn't require running the command sails lift, it just runs the platform already ...
I'm currently in a total blur as for where to go from here so if you have suggestions, I will take them with pleasure.
Thank you
Environment: Sails v1.0.2

How to configure neo4j server to use bolt

I am currently running awebapp with an embedded neo4j. Now I want to change to a standalone neo4j server using bolt. Neo4j has been loaded onto a standalone and port 7474 work as expected.
Using the following code works as expected:
var authority = neo4j.v1.auth.basic("neo4j", "XXXXXXXX");
_driver = neo4j.v1.driver("bolt://localhost ", authority, {encrypted:false});
However
var authority = neo4j.v1.auth.basic("neo4j", "XXXXXXXX");
_driver = neo4j.v1.driver("bolt://somesite.com/ ", authority, {encrypted:false});
Fails with:
neo4j-web.js:27568 WebSocket connection to 'ws://somesite.com:7687/' failed: Error during WebSocket handshake: net::ERR_CONNECTION_RESET
The port 7687 has been enabled. The neo4j version 3.0.4 and the server operating system is Centos 7.
What am I missing?
Thanks for the help
you need to enable remote connections by adding the following line to conf/neo4j.conf:
dbms.connector.bolt.address=0.0.0.0:7687
Stefan's answer works for Neo4j 3.0 (see this KB article).
For those that are having an issue like Maulik, you are probably using a more recent version of Neo4j (3.5, 4.x), in which case you need to use the following instead:
dbms.connector.bolt.advertised_address=localhost:7687
dbms.connector.bolt.listen_address=0.0.0.0:7687

Selenium Auth0 can't connect to server

I have a protractor selenium test for an angular2 that I run with protractor conf.js --params.login.username=John --params.login.password=Doe. The test shall try to log in to my backend and fail with access denied.
This is the conf.js:
exports.config = {
framework: 'jasmine2',
seleniumAddress: 'http://localhost:4444/wd/hub',
capabilities: {
'browserName': 'chrome'
},
baseUrl:'http://127.0.0.1:4200',
specs: ['mytest.spec.js'],
useAllAngular2AppRoots: true,
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000
}
}
The webdriver was started with webdriver-manager start. The app loads fine and the test fills out the Auth0 popup as shown below. It then clicks the submit button. However, this leads to the error message below being shown instead of the login happening. If I understand correctly, Auth0 can't reach the auth server (which is not the issue when logging in manually).
The version of auth0 lock is 10.0.
Through browser.pause() I could verify that other non-localhost addresses like stackoverflow.com are accessible.
Any idea where this might come from and how to solve it?
Update:
In the developer console the following message is displayed.
XMLHttpRequest cannot load https://MYDOMAIN.eu.auth0.com/usernamepassword/login.
Response to preflight request doesn't pass access control check:
No 'Access-Control-Allow-Origin' header is present on the requested resource.
Origin 'http://127.0.0.1:4200' is therefore not allowed access.
The problem was, that the local url http://127.0.0.1:4200 was not listed in the auth0 dashboard under Allowed Origins (CORS), only http://localhost:4200 which I used for testing manually.
The issue was resolved by adding http://127.0.0.1:4200 to Allowed Origins (CORS) and adding the appropriate callback URLs to Allowed Callback URLs.

Error in MySQL library for Node.js

In my Node.js app, I am trying to connect to a MySQL database hosted on Amazon.
$ npm install mysql
My code looks something like this:
var mysql = require('mysql');
var connection = mysql.createConnection({
host : 'my amazon sql db',
user : 'me',
password : 'secret',
database : 'my_db'
});
connection.connect();
connection.query('SELECT 1 + 1 AS solution', function(err, rows, fields) {
if (err) throw err;
console.log('The solution is: ', rows[0].solution);
});
connection.end();
I can connect to my MySQL DB using Workbench--therefore, I am pretty sure my credentials are okay.
When I attempt to connect I get the following error:
Connection.js:91 Uncaught TypeError: Net.createConnection is not a function
Debugging the code from the npm library--this is where the error is thrown in connection.js:
this._socket = (this.config.socketPath)
? Net.createConnection(this.config.socketPath)
: Net.createConnection(this.config.port, this.config.host);
The connection.js has a dependency :
var Net = require('net');
I am running Node.js locally on my Windows computer.
Can anyone tell me what could be causing this error?
Created a separate ticket:
Error thrown calling Node.js net.createConnection
The net module required and used in the MySQL node module is a core part of Node.js itself. The error you're getting about Net.createConnection not being a function means it's coming up as an empty object and the error is related to one of your comment to the question:
I am testing my code within a browser.
You must run this particular module on Node.js only, you can't run it in a web browser.
One could think a possibility would be to run your code through a packer like browserify or webpack so you can easily require('mysql') in your browser but it won't work. The net module which is a core dependency of the mysql module will be transformed into an empty object {}.
That's not a bug, it's how it's supposed to work. Browsers don't have generic tcp implementations so it can't be emulated. The empty object is intended to prevent require('net') from failing on modules that otherwise work in the browser.
To avoid this error, you need to run this code in a pure Node.js environment, not in a browser. A simple server could serve this purpose since this code in your client in a browser can't work and would add a security hole as everything client-side is manipulative and as such not secure. You don't want to expose your database on the client-side but only consumes it.

Register service worker failed with localhost

I have the following error when I try to register a service worker in a basic app served by a node Express V4 server / on Chrome 42:
DOMException: Failed to register a ServiceWorker: A bad HTTP response
code (404) was received when fetching the script. {message: "Failed to
register a ServiceWorker: A bad HTTP res…code (404) was received when
fetching the script.", name: "NetworkError", code: 19, INDEX_SIZE_ERR:
1, DOMSTRING_SIZE_ERR: 2…} code: 19 message: "Failed to
Here is the register code :
if ('serviceWorker' in navigator){
console.log("SW present !!! ");
navigator.serviceWorker.register('worker.js', {
//scope: '/toto/'
}).then(function(registration){
console.log('Service worker registered : ', registration.scope);
})
.catch(function(err){
console.log("Service worker registration failed : ", err);
});
}
I think You are trying to Register non-existent script. In this case this issue comes. Please check your script path and scope path. Maybe you don't have any 'worker.js' in the directory where this script exists. If this is the case, please provide full path or provide worker.js in same directory.
I also had this error when using an express server. It turns out the problem was with the server setup itself, not the service worker registration code. I had told my express app to get index.html as the default root using:
app.get('/', function(req, res) {
res.sendFile(path.join(__dirname + '/index.html'));
});
However I had not told express the location of any other files I wanted it to be able to use. At this stage my only other file was the service worker file which was sitting at the root of the directory so I fixed the problem by adding this line to the server file:
app.use(express.static(__dirname + '/'));
To debug whether your issue is with the server itself you could download Web Server for Chrome and point it at the root directory of your app. Check the server is started and click on the Web Server URL. If your service worker registration now succeeds you'll know it's a problem with your express server setup not your service worker registration code.