Using DNS #1693
-
Hello, I am not using a Uri with an IP address but a name ( http://www.Name.com) to connect to a client. I guess I have to specify the ipv4 DNS, how and when should I specify it? Thank you |
Beta Was this translation helpful? Give feedback.
Replies: 13 comments 10 replies
-
mg_mgr_init() will set Google DNS (8.8.8.8) as a default one. Line 3531 in 0a265e7 |
Beta Was this translation helpful? Give feedback.
-
Hi, thank you for your response, I am trying to join a server as client, as you see below (capture of console debug), I changed the default DNS to tcp://192.168.0.126. I got an error but can't exactly know where it came from.
|
Beta Was this translation helpful? Give feedback.
-
Thank you, you are right, I made a mistake. The DNS server use UDP and its port is 53.
I sniffed the network and compared with another application that trying to reach the same server, I am not a network master, however I saw this app trying to reach the server with its name ServerTest + the domain name as follows ServerTest.DomainName.
For your information, the server I tried to reach has a self-signed certificate. |
Beta Was this translation helpful? Give feedback.
-
Thanks, yes it works without TLS. I use a cmake project, the makefile is generated automatically. To activate TLS, I saw in the tutorial that you have to compile with arguments. |
Beta Was this translation helpful? Give feedback.
-
Maybe there is a tool CMakeMake already exists that generates CMakeLists.txt which in turn generates Makefile. The goal is to add |
Beta Was this translation helpful? Give feedback.
-
Hello, thank you for your help, I managed to enable TLS (as a reminder, the project works withoutTLS).I have the same result as in my last post with the mg_error connect: 10049. |
Beta Was this translation helpful? Give feedback.
-
Thanks, I added MG_ERROR(("Error: %s", (char *) ev_data)); but it gives the same error code without more details:
I don't see:
I added a breakpoint in the fn function and it doesn't enter in the block And yes my example is based on httpclient tutorial. |
Beta Was this translation helpful? Give feedback.
-
@jbbcst to avoid wasting your and ours time, please publish your code. That's first. Second, you've asked a question and then you've got an answer. What follows, is not a discussion, but an issue, and does not belong here. Please file an issue and supply all required information, including the code you're using to connect. |
Beta Was this translation helpful? Give feedback.
-
Sorry to waste your time, I'm just trying to solve a technical point. Ok I will file an issue and supply all required information if I can't communicate with the server. |
Beta Was this translation helpful? Give feedback.
-
Hi,
|
Beta Was this translation helpful? Give feedback.
-
Hi, I thought that because when I perform 2 communications (example below) it seems to keep the same communication opened (id 3 here) for the both. I don't see 3 closed even with verbosity level to 4. Maybe this behaviour is ok, just to know if I need to do something to explicitly close it.
Second communication:
|
Beta Was this translation helpful? Give feedback.
-
No, that is the name resolution connection to your DNS. It is handled by Mongoose and you don't have to do anything about it. |
Beta Was this translation helpful? Give feedback.
-
I have a similar problem with a websocket client I'm trying to make. When I enable my VPN (PIA) I always get a DNS timeout. This seems to be because the forces DNS requests to go via it's own DNS server, which filters out direct DNS requests to a specific server. Interestingly enough, the same resolve works fine with I'd like to be able to distribute the client I'm trying to make in the future and because of this probably cannot know if they are behind a VPN or not. It would be really cool if there was an option to force Mongoose to use |
Beta Was this translation helpful? Give feedback.
mg_mgr_init() will set Google DNS (8.8.8.8) as a default one.
If you want to set a specific DNS, just change that entry in the mg_mgr structure
mongoose/mongoose.c
Line 3531 in 0a265e7