Cloudflare for Proxy Server - proxy

I am a beginner in both Cloudflare and Proxy service, so I want your help in setting up a Proxy Server that uses Cloudflare. What I want to achieve is that user uses my proxy server in his browser settings, that proxy server itself uses Cloudflare.
I installed Squid3 on Debian server, and can use the server IP address as proxy settings in the browser, and all website loads fine. So I setup my Domain with Cloudflare Nameservers and within Cloudflare settings I put A record to my proxy server.
Now when I set that Domain name as the Proxy settings in the browser, only those websites load which are using CloudFlare's nameservers. All other websites show me Cloudflare's Error: 1001 - DNS resolution error.
My question is, is it possible to achieve what I am trying? If it is then what is the problem in this case?

CloudFlare only reverse proxy services meaning for a given domain we'll sit in front of your origin server and proxy all requests using a change to your DNS. Our self-service products don't allow you to proxy connections from a client to the internet in general.
If this is behaviour you're after, it's best to contact CloudFlare's sales team so something bespoke can be worked out.

Related

Is there a way to redirect CNAME www.mywebsite.com to https://www.mywebsite.com with ovh and heroku

I am hosting my nodejs app in heroku and my domain name is in OVH.
I managed to create a subdomain www and a CNAME record that points to my heroku app. It is working fine and SSL is also working fine from heroku.
I added a redirection from all subdomains to https://www.mywebsite.com and everything is working fine.
My problem is when i type www.mywebsite.com, there is no redirection and no SSL.
How can i redirect www.mywebsite.com to https://www.mywebsite.com ?
Thanks !
Unfortunately, No.
DNS maps domain names onto IP addresses, that is, it tells the client that example.com points to 12.34.56.78. HTTP vs. HTTPS is a matter of picking a port, and using the right protocol, and this is negotiated directly between client and server; DNS lookup has already happened before that.
If you want to redirect all plain-http traffic to https, you have to do it on the web server, not the DNS server.
In your situation, you could do this in node.js.
There tons of examples online for node's built-in http server or for frameworks like express. I'd recommend this solution.
But there are also solutions like Cloudflare.
They offer you a DNS Service and a proxy, which can handle such HTTP to HTTPS redirection and they even let you use their own SSL Certificate, so you don't need to buy (or let's encrypt) a SSL Certificate on your own, for example.

Ajaxsnapshot's proxy interfering with CloudFlare's proxy

We are using CloudFlare service for CDN, Security and other services. And we are using Ajaxsnapshot for creating snapshots for Search Bots. The problem is we are getting Error 1000 - DNS points to incorrect IP. When we switch off CLoudFlare settings, Ajaxsnapshot API works and is able to create snapshots.
How to solve it so we can use both the services?
You should contact CloudFlare support so we can look at your DNS zone file. It sounds like something isn't set properly in DNS, or you're pointing to an IP that it shouldn't be.

How to use server IP as proxy

I have full access to a server which is located in some other country. My IP address has been blocked blocked by a website and I need to use my server IP as proxy to access that particular website. I tried out with the server IP address in LAN Setting->use Proxies in my Chrome Browser but I am unable access the internet when i use that IP. How can I do this?
Just entering the server address on client side isn't sufficient. You need to set up your server to behave as a proxy server using something like squid or other alternative.

No 'Access-Control-Allow-Origin' issue, despite all resources being on same domain

I am writing a javascript/strophejs xmpp client, and have been so far using it to connect to a xmpp server hosted at hosted.im, via a public BOSH service (http://bosh.metajack.im:5280/xmpp-httpbind). The html/javascript is also hosted online, at testserver.host56.com (not the real url).
Now, I decided to host the xmpp server on the amazon web cloud, and use my own Bosh service, hosted on this server as well.
Now, my ec2 instance is at myAWSDNS.us-west-2.compute.amazonaws.com (also not real url).
I also have a BOSH service up and running, at myAWSDNS.us-west-2.compute.amazonaws.com:7070.
Finally, I have also allowed traffic to this ec2 instance through both the instances firewall and through the AWS Security Group policy.
However, when trying to connect to this instance's xmpp server (openfire), using my JS/strophejs client, I get the following message in the Chrome javascript console:
XMLHttpRequest cannot load http://myAWSDNS.us-west-2.compute.amazonaws.com:7070/. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://myAWSDNS.us-west-2.compute.amazonaws.com' is therefore not allowed access
Why am I getting this issue, if the origin is on the same domain as the requested resource?
The Ec2 instance is running Windows Server 2012.
This is the code I use to log in:
var conn = new Strophe.Connection("http://myAWSDNS.us-west-2.compute.amazonaws.com:7070/");
conn.connect("chris#myAWSDNS.us-west-2.compute.amazonaws.com", "myPassword", somecallback);
Thanks,
best regards,
Chris
As previously mentioned, even if you're on the same domain, the ports must also match otherwise CORS is required.
You may not be using the correct URL for your connection manager, all of the ones I've seen use an address ending in /http-bind/ or similar.
Have you tried connecting with Strophe.Connection("http://myAWSDNS.us-west-2.compute.amazonaws.com:7070/http-bind/");?
Also, you can test for the presence of the crossdomain.xml file by simply visiting http://myAWSDNS.us-west-2.compute.amazonaws.com:7070/crossdomain.xml to ensure that CORS has been successfully enabled.
The browser will not allow since the ports are different. I don't know what you have at AWS, but you can proxy the request in both direction, like as:
http://myAWSDNS.us-west-2.compute.amazonaws.com/http-bind/ <---------> http://myAWSDNS.us-west-2.compute.amazonaws.com:7070/
See item no 5: Connecting with Strophe.js of the tutorial for Apache use case.

How does proxy bypass firewall filter?

I am wondering how the proxy will bypass the content filter within firewall?
For example, if you are in China and try to connect to facebook, the GFW will block it. But if you use proxy server, then you can connect through. What is the logic here?
Thanks,
The Firewall blocks the web address from being accessed. A proxy has a different web address and is therefore accessible. However, the proxy is able to access the web address as it is outside the firewall. It sends the HTML code from the webpage to be accessed to your computer.
Think of the proxy as a middleman. It gets you what you want and then sends it to you, without you ever accessing the webpage directly and alerting the firewall.

Resources