Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get headers #12

Closed
abrahamjuliot opened this issue Jun 24, 2020 · 2 comments
Closed

Get headers #12

abrahamjuliot opened this issue Jun 24, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@abrahamjuliot
Copy link
Owner

@abrahamjuliot abrahamjuliot changed the title Collect and Return Headers as a seperate fingerprint Get IP address Jul 26, 2020
abrahamjuliot added a commit that referenced this issue Jul 27, 2020
@abrahamjuliot
Copy link
Owner Author

abrahamjuliot commented Jul 27, 2020

concept: https://es6console.com/kd43wbdh/

(async function() {
    const api = 'https://api6.ipify.org/?format=json'
    const res = await fetch(api)
    const data = await res.json()
    console.log(data)
})()

https://es6console.com/kd8bnj7k/

const getHeaders = async () => {
  const promiseUndefined = new Promise(resolve => resolve(undefined))

  try {
    const api = 'https://www.cloudflare.com/cdn-cgi/trace'
    const res = await fetch(api)
    const text = await res.text()
    const lines = text.match(/^(?:ip|uag|loc|tls)=(.*)$/igm)
    const data = {}
    lines.forEach(line => {
      const key = line.split('=')[0]
      const value = line.substr(line.indexOf('=') + 1)
      data[key] = value
    })
    return data
  }
  catch (error) {
  }
}
(async function() {
  const headers = await getHeaders()
  console.log(headers)
})()

@abrahamjuliot abrahamjuliot added the enhancement New feature or request label Jul 27, 2020
@abrahamjuliot abrahamjuliot changed the title Get IP address Get headers Jul 30, 2020
abrahamjuliot added a commit that referenced this issue Jul 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant