Using Charles Proxy how do you change your IP address (Making it look like it's from another country) - charles-proxy

I have a requirement where I have to route traffic from different countries to mobile application.
I want traffic coming from different countries IP addresses to mobile application. (USA, Australia etc...)
I would really appreciate it if anyone can share knowledge regarding how i can simulate this using Charles proxy.

From: https://community.openx.com/s/article/How-Do-I-Test-a-Campaign-that-Is-GeoTargeted-Using-Charles-Proxy-Tool-or-Modify-Headers-FireFox-Plugin
Tools >> Rewrite
Check off "Enable Rewrite"
Click on "Add"
Name the rule such as "Geo CA"
Click on "Add" under Locations and leave all the fields empty and hit OK. You will see an "*" under Locations. This means that all HTTP calls will contain this X-FORWARDED-FOR header
Under "Rules", hit "Add" and fill in
Type: Add Header
"Request" Checked off
Leave Match Name/Value fields empty
New: "Name" X-FORWARDED-FOR
"Value" Ip address of California. You can utilize 12.175.177.115
to mimic a Los Angeles address.
Please use a different IP address to mimic other locations.

Related

Tailscale list all devices using api

I am trying to follow the tailscale documentation to list all devices on my network using exposed API here
In the example it says that I need to provide tailnet name
GET /api/v2/tailnet/example.com/devices
curl 'https://api.tailscale.com/api/v2/tailnet/example.com/devices' \
-u "tskey-yourapikey123:"
when I replace example.com with my tailnet name I got from DNS tab on my admin page I am getting this error response
403 Forbidden
{
"message": "user tailnet does not match"
}
I am not sure what I am doing wrong and how shall I get my list of devices to see which of them is online/offline?
The name that's displayed on the DNS settings page is for hostnames (it's of the form something.ts.net), it is not meant for API calls.
The tailnet name for API calls is the identifier for your user (for single-person tailnets) or domain -- it't shown on the General settings page as the "Organization".
Even simpler, you can use - as a shorthand for the requesting user's default tailnet. The documentation covers some of this, but it could be made clearer.

Redirect my sub.my-domain.com to discord

I've been looking for a method with DNS to redirect my domain's subdomain e.g http://server.my-domain.com to https://discordapp.com/invite/server
As i found the answer of this question, i'd love to share it with all of you,
Create a CNAME on your domain named server: (or any other name you want)
Target the CNAME to: discord.gg.opts-slash.INVITECODE.redirect.center but change the INVITECODE to your server invite code
Save it and you are good to go!
Please note that:
If you want to use it for another method other than discord please remember:
.opts-slash means / for example you have http://example.com/123, to redirect your http://example.my-domain.com/ to http://example.com/123 type in the CNAME example.com.opts-slash.123.redirect.center and your CNAME name to example.
As i couldn't get it to work redirecting it directly through a CNAME, i had success by creating a simple netlify app which is just redirecting via JS:
Create index.html with the following content:
<html>
<head>
<title>Discord redirect</title>
</head>
<body>
<script>
window.location.replace("https://discord.com/invite/INVITECODE");
</script>
</body>
</html>
Place the index.html inside a folder and upload it to netlify
You'll get a unique name, such as eloquent-noyce-x00xx0
Set a CNAME to your app with eloquent-noyce-x00xx0.netlify.app. (last dot is important!)
Set your mydiscord.mydomain.com as custom domain in netlify
That's it, visit mydiscord.mydomain.com and it'll redirect you
For me redirect like previous answer doesn't work.
Free (minus the domain name) and easy solution is to use Amazon Web Services. Create an AWS account and follow this guide:
https://kennbrodhagen.net/2016/04/02/how-to-return-302-using-api-gateway-lambda/
Then use Route53 to create a CNAME to redirect to the API Gateway:
How to CNAME to Amazon API Gateway Endpoint
1) Create a Discord invite that never expires.
2) Use the .GG URL to find the .COM URL. You will be redirected in the browser when you paste the .GG URL into the browser.
https://discord.gg/abc12de (redirected to) -> https://discordapp.com/invite/abc12de
Note: abc12de (example) stays the same between the two URLs.
3) In your GoDaddy domain, scroll down and to the right. Select Forwarding.
4) FORWARD TO: (Drop down) https:// (fill in box) discordapp.com/invite/abc12de <- Note: remove https from the original URL.
5) FORWARD TYPE: Permanent (301)
6) SETTINGS: Forward Only
7) Save and wait.
8) You'll notice a new A Record is created with a TTL of 600 seconds. This shows your settings have taken and should now work.
URL with additional info: https://www.godaddy.com/help/forward-my-domain-12123
This worked for me:
Create a "A" DNS Record with name "discord" pointing to 8.8.8.8
Create a page rule of url forwarding to your server invite called "discord.mydomain.com"
The CNAME way doesn't work!
It works for me thanks full tutorial in case someone understood it.
This is for CloudFlare
Created Add Record "A"
this type "A" must contain in Name: "Name you want for the sub domain", and in IPv4 address they must place "8.8.8.8", Proxy status activated.
IMG Add Record
Then they go to "Rules"
Here they add a Create a new rule, and place the following data in URL: "yoursubdomanin.yourdomain.com", luen in Then the settings are: Select "Forwarding URL", then in Select status code: Select "301 - Permanent Redirect"
in Enter destination URL (required) you put the url of the Discord invitation: "https://discord.gg/yourInviteCode".
IMG Rules
That's how it works, in case it doesn't load you because you have already tried many methods with "discord.yourdomain.com", try another subdomain while the other one is reactivated or try from another device, example of another dub domain "discord1. yourdomain.com".
That's bye :D

HA Proxy ACL for URL matching dynamically

Recently I have gone through HA Proxy ACL details and need help with a specific scenario. My scenario is given below.
My URL's will be like https://companyName.research.com/index. Company name is dynamic today I have 2 companies and later it may reach to hundred.In the ACL section it normally checks in URL that if any particular String exist or not and according to that forward to back end. This configurations are not dynamic. Like I have one URL start with blog then will forward it to blog back end. But my scenario is completely different. Here system will check is any company name exist or not if exist then it will forward the request to the back end with that company name dynamically. Like if company dummy given forward it to dummy. But as I said company names are not known to me so, it's ha proxy which will fetch the company name from url and will find the suitable backend with name matching and will forward. Is that possible with HA Proxy.
This can be achieved through HAProxy ACL. In has 2 section, fronted and backend. In frontend redirection
Frontend:
acl is_valid_base_domain hdr_end(host) -i mydomain.com
use_backend BE:subs-%[req.hdr(host),lower,field(1,'.')] if is_valid_base_domain
This checks if the domain belongs to mydomain and if yes then take the same. Example: one.mydomain.com. In this case it will fetch the domain name "one" and will redirect to BE:subs-one backend.
Define a backend BE:subs-one
You are ready to go.

Set up custom subdomain for Jekyll Blog hosted in Github Pages

I created a Jekyll-powered blog and am hosting it with GitHub Pages.
Now, I want to set up a subdomain (blog.example.com), but can't make it work.
I have added a CNAME file with the text: blog.example.com. And I have added two A records in my Dreamhost account for the subdomain, both pointing to 204.232.175.78, provided by GitHub.
Any idea about what the missing part is, or if I'm doing something incorrectly?
The setup is different for domains like example.com and sub-domains like blog.example.com.
In case of a sub-domain: blog.example.com
Go to Domains | Manage Domains in your webpanel
Locate blog.example.com, click Delete in the Actions column
Wait 10 minutes, and then click the DNS link below example.com
Add a CNAME record:
Name = blog
Type = CNAME
Value = yourusername.github.io. (yes there is a . at the end!)
In case of a domain: example.com
Go to Domains | Manage Domains in your webpanel
Locate example.com, click Edit in the Actions column and switch to DNS only hosting (it's at the bottom)
Go back to Domains | Manage Domains in your webpanel
Click the DNS link below example.com
Add an A record:
Name = (blank, nothing)
Type = A
Value = 185.199.108.153 (GitHub, from this page)
Add a CNAME record:
Name = www
Type = CNAME
Value = yourusername.github.io. (yes there is a . at the end!)
(Yes, you need both the A and CNAME records in this case.)
Btw, the only reason I know this is because I did the same thing last weekend. I was quite lost, but the helpful support guys helped me half way, and I figured out the rest. This procedure works for me, I needed both cases so I tested both.
Because of the way DNS records are cached across the internet, these sorts of changes can take a few hours to take effect. It looks like the address you provided resolves correctly now.

How to point domain to site hosted on github pages?

I have created a website and placed it on github in the repo with USRNAME.github.com. First when I went to that website, my website displayed correctly. Then I bought a domain, lets say example.com. I placed a CNAME file in the repo, so now USRNAME.github.com forwards to example.com.
I understand that I have to point my domain at the github server in order to allow my website to be displayed at example.com, but I'm not sure how. I created the site through gandi.net. I tried editing the zone file to have a CNAME entry with USRNAME.github.com but that didn't work. I also tried to edit the DNS server name but no entry I placed in there seemed valid.
Any help would be greatly appreciated. Thanks.
As you understood, the CNAME file on the github side must be completed by a custom DNS setting on the registrar side, in order to complete the matching between your domain name (example.com) and the subdomain on github. The CNAME file is required by github to route incoming request on its own DNS Zone (192.30.252.153) to the proper user subdomain.
Therefore, the missing step is having your domain actually pointing to github's DNS Zone. On the registrar side (gandi.net), you achieve that by editing the DNS Zone file attached to your domain. This zone file describes the hierarchical domain name structure of the DNS Zone that your very domain pertains to. What you are about to do is changing the mapping between some parts of your DNS Zone and IPs. When you want to point a top-level-based domain name to an arbitrary IP v4 (here, github's DNS Zone located at 192.30.252.153), you are interested in redefining an A Record (A simply standing for "Address") in your own zone.
A specific answer for gandi.net:
head to https://www.gandi.net/admin/domain
click on the domain you want to use
at the bottom of its admin page, under "Zone files", click on "Edit the zone"
Here you can see the list of settings for your zone file. A new feature of Gandi is that of "versions": different versions of the zone file can be created and only one is active at a time.
To tweak the zone file for github, first click on "Create a new version". It will simply create a copy of the currently activated version.
The preferred way for wiring is to add a new CNAME mapping, from *.{yourdomain.tld} to {youraccount}.github.io. For instance, my kaibun.net domain must be the facade for chikamichi.github.io, so I added a CNAME mapping *.kaibun.net to chikamichi.github.io. (the final dot is mandatory in gandi's config).
You may want to edit the * and # record types settings as well, for instance if you just want the whole DNS zone to behave like a "proxy" (meaning it will "redirect" to your github subdomain no matter what). This is not required though, so this step is optional. I assume you are still in Normal edit mode. Click on the Pen icon on the right side of the * line. Keep all fields untouched but the "Value" one: paste the github URI in (the github documentation recommends using 204.232.175.78; you may have found different values on the internet, though: don't use them). Validate, then proceed the same for the # line.
Do not forget to click on "Activate this version" when you're ready. Check that the "Active version number" is correct. The changes will take some time to propagate.
Detailled examples and procedure: http://wiki.gandi.net/dokuwiki/en/dns/zone/a-record
You need to setup an A record which points to the github server. You said you used gandi.net, so basically you would change your DNS settings for the top level domain by adding(or modifying) an A record to point to github.
If you want, you can add a subdomain (like www.) by adding a CNAME in your DNS to point to the top level domain or an A record which, again, points to github.