
rel 링크를 통해 URL의 점프를 추적하여 최종 URL을 얻는 보안 도구
Hoper는 URL이 최종 목적지에 도달할 때까지 거치는 모든 홉(리다이렉트)을 보여줍니다 — URL 단축기, 이메일 내 추적 링크, SSO 흐름 또는 리다이렉트 규칙 디버깅에 유용합니다.
$ hoper http://github.com
Tracing http://github.com
1. → 301 Moved Permanently http://github.com/ 81ms
2. ✔ 200 OK https://github.com/ 50ms
1 redirect → https://github.com/
HEAD를 사용하며(본문 다운로드 없음), 이를 거부하는 서버에 대해서는 자동으로 GET으로 폴백합니다.HTTP_PROXY / HTTPS_PROXY / NO_PROXY 및 NO_COLOR를 준수합니다.Ruby 3.1 이상이 필요합니다.
gem install hoper
Windows에서는 RubyInstaller로 Ruby를 설치한 다음 동일한 명령을 실행하세요.
hoper [options] URL [URL...]
-m, --max-hops N Maximum redirects to follow (default: 20)
-t, --timeout SECONDS Timeout per request (default: 10)
-X, --method METHOD HTTP method: HEAD or GET (default: HEAD)
-A, --user-agent UA User-Agent header to send
-H, --header 'NAME: VALUE' Extra request header (repeatable)
-k, --insecure Do not verify TLS certificates
-j, --json Output results as JSON
--[no-]color Force/disable colored output
-v, --version Print version and exit
-h, --help Show this help
스킴이 생략되면 https://가 가정됩니다(hoper example.com).
hoper --json http://github.com
{
"start_url": "http://github.com/",
"final_url": "https://github.com/",
"final_status": 200,
"redirects": 1,
"hops": [
{ "url": "http://github.com/", "status": 301, "reason": "Moved Permanently", "location": "https://github.com/", "duration_ms": 81 },
{ "url": "https://github.com/", "status": 200, "reason": "OK", "duration_ms": 50 }
]
}
여러 URL을 사용하면 출력은 배열입니다.
| 코드 | 의미 |
|---|---|
| 0 | 모든 URL이 오류가 아닌(< 400) 최종 응답으로 해석됨 |
| 1 | 하나 이상의 URL이 실패함(네트워크 오류, 루프, 홉 초과, 4xx/5xx) |
| 2 | 잘못된 사용법 / 옵션 |
require "hoper"
result = Hoper.trace("https://bit.ly/example", max_hops: 10)
result.hops.each { |hop| puts "#{hop.status} #{hop.url}" }
result.final_url # => "https://example.com/"
result.success? # => true
bundle install
bundle exec rake test
CI는 Ubuntu, macOS, Windows(Ruby 4.0)와 Ubuntu에서 지원되는 가장 오래된 Ruby(3.1)에서 테스트 스위트를 실행합니다. 테스트는 로컬 인프로세스 HTTP 서버를 사용하므로 네트워크 액세스가 필요하지 않습니다.
릴리스는 GitHub Actions와 RubyGems Trusted Publishing으로 자동화됩니다:
lib/hoper/version.rb의 버전을 올리고 CHANGELOG.md에 섹션을 추가한 뒤 master에 병합합니다.
태그를 생성하고 푸시합니다:
git tag v1.2.3 && git push origin v1.2.3
Release 워크플로는 태그가 버전과 일치하는지 확인하고, 테스트를 실행하며, gem을 RubyGems.org에 게시하고, CHANGELOG 노트와 함께 GitHub Release를 생성합니다.
버그 보고와 풀 리퀘스트는 GitHub(https://github.com/gabamnml/hoper)에서 환영합니다. 이 프로젝트는 안전하고 환영하는 협업 공간이 되고자 하며, 기여자는 Contributor Covenant 행동 강령을 준수할 것으로 기대됩니다.
이 gem은 MIT License 조건에 따라 오픈 소스로 제공됩니다.