B4A Library [Lib] Global Proxy Connector & DNS Changer

scsjc

Well-Known Member
Licensed User
Longtime User
Hi good morning
I have been testing, and I have not been able to get it to work, I send an example that I have created following your instructions.

I have tried testing it on a virtual device and on my samsung s8, in both cases it does not work.
The VPN is created correctly and the padlock is correctly placed, but I do not have internet access (with Wi-Fi connection and data connection)
 

Attachments

  • proxy-dns-test.zip
    9.3 KB · Views: 240

sfsameer

Well-Known Member
Licensed User
Longtime User
Hello,

Just checked the library, it seems that it's mandatory to be connected to a proxy server before changing the DNS, we will look into it tonight and update it accordingly

Thank you,
Saif
 

scsjc

Well-Known Member
Licensed User
Longtime User
Hello,

Just checked the library, it seems that it's mandatory to be connected to a proxy server before changing the DNS, we will look into it tonight and update it accordingly

Thank you,
Saif

it's weird, because the application DNSChanger doesn't need to be with a proxy server. directly change dns only and it works.
Thank you very much for reviewing it
 

sfsameer

Well-Known Member
Licensed User
Longtime User
it's weird, because the application DNSChanger doesn't need to be with a proxy server. directly change dns only and it works.
Thank you very much for reviewing it
This library is not based on DNSChanger so their code/approach would be different, this library was built to connect to a proxy server

Tonight we will upload a new update that doesn't require the user to connect to a proxy server in case he/she wants to change the DNS only

 

scsjc

Well-Known Member
Licensed User
Longtime User
thanks
 

sfsameer

Well-Known Member
Licensed User
Longtime User
Hello,

Unfortunately the DNS service will not run without setting up a proxy connection first.
I think in the near future we will release a separate library that will only change the DNS without the need to set up a proxy connection.

Thank you,
Saif
 

scsjc

Well-Known Member
Licensed User
Longtime User
thanks a lot .... in a future
 
Anyone been able to get the AddDNSServer function to work? Please provide working example of proxy and DNSServer commands in use. I have been able to get a working proxy connection, but the DNS settings are completely disregarded. I have been able to make a working application using VPNService and change the DNS settings in Android Studio, but was hoping to use B4a to expedite development and add in a few quick extras to the app...
 

sfsameer

Well-Known Member
Licensed User
Longtime User
Hello,

Please read the first post, it's mentioned there how to use the proxy with DNS Server, but you have set a proxy connection to be able to set the DNS.

*Use Library Version 2, below is the code example :
B4X:
Sub Globals
    Dim b4xpc As B4XCodeProxyConnector
End Sub

Sub Activity_Create(FirstTime As Boolean)
    b4xpc.Initialize
    b4xpc.AddDNSRoute("195.46.39.39")
    b4xpc.AddDNSRoute("208.67.220.220")
    b4xpc.CreateService
    b4xpc.SetProxyServer("94.127.212.200",5900)
End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)
    If UserClosed Then
        b4xpc.StopProxyService
    End If
End Sub

We have tested it and it works fine :

Thank you,
Saif
 
I just re-tested your code snippet by copy and paste directly, as well as using custom settings, replacing the DNS with UltraDNS IPs:

156.154.70.3
156.154.71.3

which should show a red page stating "Blocked" for example, if you try to visit "hotbar.com" or "crack4windows.com" - and indicate the page is blocked.

Upon testing, the page goes straight to the actual website and is not blocked (DNS blocks bad domains and supplies IP of block page server) so DNS is not being considered.

Please try connecting with proxy 64.124.38.138:8080 with the DNS above - it simply does not work. I can send you my application code to verify and confirm also that it is not working.

I can code this same app in Android Studio all day long and it works perfectly fine doing what I'm attempting with B4A - only less hassle and it actually works - so something is not right unfortunately.

Then for example, if you add DNS "62.151.180.19" you should be able to resolve a non standard ICANN TLD for ".pi" domains -example "http://app.pi" should reveal a blank page with basic text...

Please test and confirm. I've tested the app on over a dozen devices... all successfully connect to the proxy and adopt the proxy IP address, but no DNS settings stick or are considered by the VPN connection - only the DNS of the proxy server is considered/invoked for name resolution.


**In one of your first statements you indicate that the proxy must be setup BEFORE adding DNS - your code shows you adding DNS BEFORE setting up the proxy - I've tried before setting up the proxy, after setting up the proxy, after starting proxy.. before creating the service... I'm baffled. Will get source together this evening to run by you.
 
Last edited:
Please try the attached demo - The proxy service works perfectly. For some reason, AddDNSServer does not work and the included WebView will not resolve the invoked domain which only exists on the specified DNS server; which is also an authoritative server. Please report back after testing. Thanks!
 

Attachments

  • proxytest.zip
    10.3 KB · Views: 189
Hi @sfsameer This Library still working ? I try my on my side, there are no any error. but just not working.
I can't seem to get it to work either. Has been months since I inquired... Ended up writing our app in Android Studio since we had full control over the code and any issues that could arise. B4A libraries, unless open source, don't allow such and you're stuck with a broken product unless you reinvent the wheel - then, you might as well code the app out entirely...
 

lkching7

Member
Licensed User
Longtime User
Actually I search for solution very long time also.
 

sfsameer

Well-Known Member
Licensed User
Longtime User
Hello,

As the first post states :


First connect to a proxy server, then add the DNS.

If you are being blocked as you state then this is a proxy server issue and not the library issue, the library connects to a proxy server nothing else.


This library has been tested and used by a lot of B4X members and it's working without any problems.

If you couldn't get it to work, then please don't use it, this library is free and public and if you can't or unable to use it then don't use it rather than making a statement that has nothing to do with the above issue.

Thank you,
Saif
 

nedium

Active Member
Licensed User
Longtime User
Hello, I know it's been a long time but I wanted to know if the library to only change DNS had been created or if it can currently be used just for that.

thank you so much
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…