{"id":17062525,"url":"https://github.com/skateman/surro-gate","last_synced_at":"2025-09-10T08:34:34.252Z","repository":{"id":59156906,"uuid":"71156235","full_name":"skateman/surro-gate","owner":"skateman","description":"A general purrpose TCP-to-TCP proxy implemented in Ruby","archived":false,"fork":false,"pushed_at":"2019-03-18T14:11:40.000Z","size":59,"stargazers_count":11,"open_issues_count":1,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-04-24T01:02:03.210Z","etag":null,"topics":["networking","proxy","ruby","tcp"],"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/skateman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-10-17T16:02:37.000Z","updated_at":"2023-08-15T19:01:31.000Z","dependencies_parsed_at":"2022-09-13T20:11:37.328Z","dependency_job_id":null,"html_url":"https://github.com/skateman/surro-gate","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skateman%2Fsurro-gate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skateman%2Fsurro-gate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skateman%2Fsurro-gate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skateman%2Fsurro-gate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/skateman","download_url":"https://codeload.github.com/skateman/surro-gate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248610686,"owners_count":21132984,"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":["networking","proxy","ruby","tcp"],"created_at":"2024-10-14T10:50:10.541Z","updated_at":"2025-04-12T18:21:52.294Z","avatar_url":"https://github.com/skateman.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SurroGate\n\n[![Gem Version](https://badge.fury.io/rb/surro-gate.svg)](https://badge.fury.io/rb/surro-gate)\n[![Build Status](https://travis-ci.org/skateman/surro-gate.svg?branch=master)](https://travis-ci.org/skateman/surro-gate)\n[![Inline docs](http://inch-ci.org/github/skateman/surro-gate.svg?branch=master)](http://inch-ci.org/github/skateman/surro-gate)\n[![Code Climate](https://codeclimate.com/github/skateman/surro-gate/badges/gpa.svg)](https://codeclimate.com/github/skateman/surro-gate)\n\nSurroGate is a generic purrpose TCP-to-TCP proxy for Ruby implemented using epoll.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'surro-gate'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install surro-gate\n\n## Usage\n\n```ruby\nrequire 'surro-gate'\n\nproxy = SurroGate.new\n\n# Create a pair of TCP socket connections\nsock_1 = TCPSocket.new('localhost', 1111)\nsock_2 = TCPSocket.new('localhost', 2222)\n\n# Push the pair of sockets to the proxy\nproxy.push(sock_1, sock_2)\n\nloop do\n  # Select with a 1 second timeout\n  proxy.select(1000)\n\n  # Do some hard work\n  proxy.each_ready do |left, right|\n    begin\n      right.write_nonblock(left.read_nonblock(4096))\n    rescue =\u003e ex\n      # ...\n      proxy.pop(left, right) # Remove the failed connection pair from the proxy\n    end\n  end\nend\n\n```\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/skateman/surro-gate.\n\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskateman%2Fsurro-gate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskateman%2Fsurro-gate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskateman%2Fsurro-gate/lists"}