{"id":21878337,"url":"https://github.com/pepabo/passthrough","last_synced_at":"2025-03-21T23:45:03.458Z","repository":{"id":146415902,"uuid":"47180734","full_name":"pepabo/passthrough","owner":"pepabo","description":"Provides a pass-through functionality using net-ssh-gateway","archived":false,"fork":false,"pushed_at":"2015-12-11T14:00:28.000Z","size":7,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-01-26T18:17:32.284Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pepabo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-12-01T09:55:47.000Z","updated_at":"2016-07-01T17:37:41.000Z","dependencies_parsed_at":"2023-04-15T14:42:25.191Z","dependency_job_id":null,"html_url":"https://github.com/pepabo/passthrough","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pepabo%2Fpassthrough","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pepabo%2Fpassthrough/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pepabo%2Fpassthrough/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pepabo%2Fpassthrough/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pepabo","download_url":"https://codeload.github.com/pepabo/passthrough/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244885532,"owners_count":20526293,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-28T08:12:20.923Z","updated_at":"2025-03-21T23:45:03.428Z","avatar_url":"https://github.com/pepabo.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Passthrough\n\nThis library provides a pass-through functionality using [net-ssh-gateway](https://github.com/jamis/net-ssh-gateway).\n\n## Usage\n\n```ruby\n# Gateway setting\nPassthrough.create(:db, 'gateway.example.com', 'readonly-user')\n\n# Destination setting(host + port)\nPassthrough.set(:db, :host, 'db.example.com')\nPassthrough.set(:db, :port, 3306)\n\n# Establish a connection for TCP port forwarding\nPassthrough.open(:db)\n\n# You can create multiple connections like below\nPassthrough.create(:search, 'gateway.example.com', 'readonly-user')\nPassthrough.set(:search, :host, 'search.example.com')\nPassthrough.set(:search, :port, 8983)\n\n# Same as above\nPassthrough.open(:search)\n```\n\nUse the sets of host and port in some config file.\n\n`database.yml` of Rails:\n\n```yaml\nremote:\n  database: example_database\n  username: readonly_user\n  password: ****************\n  host:     \u003c%= Passthrough.get(:db, :host) %\u003e\n  port:     \u003c%= Passthrough.get(:db, :port) %\u003e\n```\n\n`sunspot.yml` for Solr:\n\n```yaml\nremote:\n  solr:\n    hostname: \u003c%= Passthrough.get(:search, :host) %\u003e\n    port:     \u003c%= Passthrough.get(:search, :port) %\u003e\n```\n\n## Description\n\nServers such as database or search engine are usually in a local network where you can't access directly. You, however, often want to access them from your local machine, for example, to collect production data for inquiry.\n\nTo solve the problem, TCP port forwarding through SSH connection works fine.\n\n```sh\n$ ssh -L 12345:db.example.com:3306 gateway.example.com\n```\n\nThis line creates so-called a pass-through which forwards the connection to `127.0.01:12345` to `db.example.com:3306` via `gateway.example.com`.\n\nThis library allows you to do the same as above in a programmatic way.\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/pepabo/passthrough. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n\n## Authors\n\n* Takatoshi Ono\n* Kentaro Kuribayashi\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpepabo%2Fpassthrough","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpepabo%2Fpassthrough","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpepabo%2Fpassthrough/lists"}