{"id":15032922,"url":"https://github.com/ruby/gserver","last_synced_at":"2025-10-19T22:32:13.055Z","repository":{"id":19718218,"uuid":"22973886","full_name":"ruby/gserver","owner":"ruby","description":"GServer implements a generic server","archived":false,"fork":false,"pushed_at":"2023-03-21T12:37:26.000Z","size":13,"stargazers_count":33,"open_issues_count":3,"forks_count":11,"subscribers_count":32,"default_branch":"master","last_synced_at":"2025-04-06T04:51:14.156Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ruby.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-08-15T01:12:12.000Z","updated_at":"2025-01-20T17:11:37.000Z","dependencies_parsed_at":"2022-08-24T14:09:03.136Z","dependency_job_id":null,"html_url":"https://github.com/ruby/gserver","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/ruby/gserver","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruby%2Fgserver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruby%2Fgserver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruby%2Fgserver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruby%2Fgserver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ruby","download_url":"https://codeload.github.com/ruby/gserver/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruby%2Fgserver/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279927574,"owners_count":26245504,"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","status":"online","status_checked_at":"2025-10-19T02:00:07.647Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-09-24T20:19:44.566Z","updated_at":"2025-10-19T22:32:12.774Z","avatar_url":"https://github.com/ruby.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gserver\n\nGServer implements a generic server, featuring thread pool management,\nsimple logging, and multi-server management.  See HttpServer in\n\u003ctt\u003esample/xmlrpc.rb\u003c/tt\u003e in the Ruby standard library for an example of\nGServer in action.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'gserver'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install gserver\n\n## Usage\n\nUsing GServer is simple.  Below we implement a simple time server, run it,\nquery it, and shut it down.  Try this code in `irb`:\n\n```ruby\nrequire 'gserver'\n\n#\n# A server that returns the time in seconds since 1970.\n#\nclass TimeServer \u003c GServer\n  def initialize(port=10001, *args)\n    super(port, *args)\n  end\n  def serve(io)\n    io.puts(Time.now.to_i)\n  end\nend\n\n# Run the server with logging enabled (it's a separate thread).\nserver = TimeServer.new\nserver.audit = true                  # Turn logging on.\nserver.start\n```\n\nNow, point your browser to http://localhost:10001 to see it working.\n\n```ruby\n# See if it's still running.\nGServer.in_service?(10001)           # -\u003e true\nserver.stopped?                      # -\u003e false\n\n# Shut the server down gracefully.\nserver.shutdown\n\n# Alternatively, stop it immediately.\nGServer.stop(10001)\n# or, of course, \"server.stop\".\n```\n\nAll the business of accepting connections and exception handling is taken\ncare of.  All we have to do is implement the method that actually serves the\nclient.\n\n## Contributing\n\n1. Fork it ( https://github.com/ruby/gserver/fork )\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruby%2Fgserver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fruby%2Fgserver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruby%2Fgserver/lists"}