Rethinkdb invalid url error - rethinkdb

I have RethinkDB installed on my server and I am able to access the admin dashboard without issues, however, I am not able to connect an app to the server. I have the following code on my app:
r = require('rethinkdb');
r.connect({ host: 'my_server_ip_address', port: 28015 }, function(err, conn) {
if(err) throw err;
r.db('test').tableCreate('tv_shows').run(conn, function(err, res) {
if(err) throw err;
console.log(res);
r.table('tv_shows').insert({ name: 'Star Trek TNG' }).run(conn, function(err, res)
{
if(err) throw err;
console.log(res);
});
});
});
I have made sure to have the host address match the client address, and it is the same address I used to successfully connect to the rethinkdb admin dashboard, but for some reason, I get the following error "Failed to execute 'open' on 'XMLHttpRequest': Invalid URL" I don't know if I am supposed to type in a url or the ip address or what as EVERY tutorial that I have found assumes that rethinkdb is installed on a localhost, so just localhost is used as a host, which doesn't help me at all.

Probably IP address of server 109.1.0.168:port being the database port. If it helps you can Google gettingnifty heavy evil I have a MySQL connection in the main window application. Start there and look for something similar in your database. They vary by version so check Oracle etc. Or 10.0.0.1 windows is netstat -arng ( all, numerical, routing, groups), Unix is ifconfig or ipconfig I believe. If it's localhost, localhost should be subnet. In gaming applications on the client side there are advantages to opening your Nat.
Please edit

Related

How to connect to stun and turn servers using simple peer

I developed a video chatting application using simple peer and socket.io . But when I tried hosting the application the peers could not be connected because of the firewall issue . I am aware that STUN and TURN servers are to be used for this purpose . Is it possible to connect to those servers using simple peer ?
If so how?
Any explanation or reference articles will be helpful
You can add the iceServer configuration like in original webrtc in the simple-peer config like so:
{
initiator: false,
config: { iceServers: [{ urls: 'stun:stun.l.google.com:19302' }, { urls: 'stun:global.stun.twilio.com:3478?transport=udp' }] },
}
You can add stun servers and/or turn servers.
If you read the source code of the simple-peer npm package you will realize that it currently uses
URLs: [
'stun:stun.l.google.com:19302',
'stun:global.stun.twilio.com:3478'
]
for its public IP discovery needs.
Your app fails to work in case of firewall because just stun server is insufficient in case of firewall.
Besides a STUN server, you need a TURN server is this case.
TURN is the fallback is case STUN fails to deliver.

TLS handshake error from xx.xx.xx.xx:14333: EOF

I am running a HTTPS server in Linux (RHEL 7). I am getting the below error as soon as I start the server.
2019/09/04 15:46:16 http: TLS handshake error from xx.xx.xx.xx:60206: EOF
2019/09/04 15:46:21 http: TLS handshake error from xx.xx.xx.xx:31824: EOF
This error is coming automatically and continuously in the terminal.
Below is the go code for creating https server -
package main
import (
"fmt"
"net/http"
"github.com/gin-gonic/gin"
)
func main() {
fmt.Println("Starting webserver")
router := gin.Default()
router.GET("/", func(c *gin.Context) {
c.JSON(http.StatusOK, gin.H{
"success": true,
})
})
router.RunTLS(":9001", "server.pem", "server.key")
}
We have purchased and combined the server certificate, intermidate certificate and root certificate into a single file to make the server.pem file.
As this error is coming continuously and in the terminal as soon as I start the server, I think there is some configuration problem in the VM?
Please suggest what are the things I can check here.
NOTE: This error is specific to the Go. I have tested on the same server on the same port with same certificates in Node JS. And it works fine.
Also the IP in the error message is of the reverse proxy server (WAF) which is continuosly doing health monitoring of the web application server.
I would attack the problem from two angles:
What is this xx.xx.xx.xx address? I'd expect that when I start some random piece of software, there is nothing to connect to it all by itself, right?
Is there anything special about that 9001 port? Try running nc -l -p 9001 and see whether those unidentified connections happen as well.
Run tcpdump and see whether there is any incoming traffic from the clients making those connections: those EOFs (that's "end of file") reported by the TLS mchinery most probably mean those clients—whatever they are—close their side of the connection somewhere amidst the TLS handshake—while the server is expecting to read some data from them.
This hints at that those clients do not actually expect to see TLS protocol in the connection they open; and they pretty much may send some plaintext in it, so you'll be able to peek at it.
Googling for "9001 port" hints at that it's used for some "ETL service manager" protocol—whatever it is. This hints at that traffic on 9001 might be related to VoIP.
I have no idea what to do with this, but it might give you some lead for further research.

Unable to get response from fetch request using 127.0.0.1 in React-native

I am using rest services to get the response for my react-native android app. Whenever I am using the localhost(i tried with 127.0.0.1) with port 8080 but fetch is giving me [TypeError: Network request failed]. Fetch request is working fine without localhost. Rest service is working fine when used with Postman.
I am running my code using expo.
And for backend dependency using Maven.
I tried with both physical device and emulator both failed, checked with port 9090.
I tried to change the server address in the application.properties file after which spring-boot backend stopped which is due to server address configuration problem.
(Error:
APPLICATION FAILED TO START
Description:
The Tomcat connector configured to listen on port 9090 failed to start. The port may already be in use or the connector may be misconfigured.
Action:
Verify the connector's configuration, identify and stop any process that's listening on port 9090, or configure this application to listen on another port.)
insertPost() {
return fetch('http://127.0.0.1:9090/getPost/PO397ba3306cc211e98f8249277cd661ec')
.then(res => res.json())
.then(json => {
console.log(json)
})
.catch(error => console.error(error));
}
console.log(json) should print the object returned from fetch.
You should use the 'IP address' of your system
http://YourIpAddress:9090/getPost/PO397ba3306cc211e98f8249277cd661ec
Please check your connected device and system in the same network. Please refer below documentation:
https://facebook.github.io/react-native/docs/running-on-device
You shouldn't return the fetch function. Try to remove the return word to see if it works.
Try using this,
http://10.0.2.2:portnumber/
10.0.2.2 - Special alias to your host loopback interface (i.e., 127.0.0.1 on your development machine)

Heroku Connection Error

I have a separate Backbone client and a server that it needs to connect to. I'm using socket.io and this is my server config as of now:
var IOServer = require('socket.io')
var port = (process.env.PORT || 9720),
io = new IOServer(port);
From what I've read, heroku assigns you a random port number. But I think it should work if I just put the link
var socket = io.connect('https://thawing-tundra-87100.herokuapp.com');
When I go to the server link above, I get
This thawing-tundra-87100.herokuapp.com page can’t be found
No webpage was found for the web address: https://thawing-tundra-87100.herokuapp.com/
HTTP ERROR 404
But checking the logs, it's running correctly I believe.
So the server is on heroku and I am trying to connect to the server using my localhost instance of the client. However, the client is getting a connection refused
https://thawing-tundra-87100.herokuapp.com:5000/socket.io/?EIO=2&transport=polling&t=1482456831163-0 Failed to load resource: net::ERR_CONNECTION_REFUSED
Is there something else I need to do or am I missing something?

FTP Connection Refused (Using FTPZilla)

I have googled and searched all over but I am still having trouble getting connected to a site using the ftpzilla
I am getting this read out when I try to connect to the server using the network connection wizard
Connecting to probe.filezilla-project.org
Response: 220 FZ router and firewall tester ready
USER FileZilla
Response: 331 Give any password.
PASS 3.9.0.6
Response: 230 logged on.
Checking for correct external IP address
Retrieving external IP address from
http://ip.filezilla-project.org/ip.php
Checking for correct external IP address IP 173.56.114.112
bhd-fg-bbe-bbc
Response: 200 OK
PREP 60010
Response: 200 Using port 60010, data token 1063172065
PORT 173,56,114,112,234,106
Response: 200 PORT command successful
LIST
Response: 150 opening data connection
Response: 503 Failure of data connection.
Server sent unexpected reply.
Connection closed
The weird thing is I only get this error for this particular server and the server I use for my personal site (namecheap.com) gives me no such error. Does anyone know why this may be happening? And please try not to point me to the network configuration wiki because I have read through that and I still am at this point.
PORT 173,56,114,112,234,106
....
Response: 503 Failure of data connection.
...
please try not to point me to the network configuration wiki
You are using active mode, that is the ftp client (FileZilla) waits for a connection from the server. Obviously the server can not connect to the client which indicates that something like a firewall restricts the connection.
Since according to your description this happens only with few servers, you either use only these servers with active mode or these servers are protected by firewalls which do not allow active mode. Have you tried with passive mode?
I had a similar issue connecting and made the following changes and had success.
Go to File>>>Site Manager>>>
For my site, I changed the Encryption to "Only use plain FTP(insecure)" and had success. May you find the same success.

Resources