{"id":26913645,"url":"https://github.com/worldline-go/forward","last_synced_at":"2025-04-01T16:38:23.150Z","repository":{"id":40778409,"uuid":"508042478","full_name":"worldline-go/forward","owner":"worldline-go","description":"export connections","archived":false,"fork":false,"pushed_at":"2024-09-07T19:20:04.000Z","size":37,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-07T21:07:24.519Z","etag":null,"topics":["docker","go","traefik"],"latest_commit_sha":null,"homepage":"","language":"Go","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/worldline-go.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":"2022-06-27T19:49:11.000Z","updated_at":"2024-09-07T19:02:51.000Z","dependencies_parsed_at":"2022-09-10T17:31:14.336Z","dependency_job_id":null,"html_url":"https://github.com/worldline-go/forward","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/worldline-go%2Fforward","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/worldline-go%2Fforward/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/worldline-go%2Fforward/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/worldline-go%2Fforward/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/worldline-go","download_url":"https://codeload.github.com/worldline-go/forward/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246671912,"owners_count":20815288,"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":["docker","go","traefik"],"created_at":"2025-04-01T16:38:22.546Z","updated_at":"2025-04-01T16:38:23.141Z","avatar_url":"https://github.com/worldline-go.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# forward\n\n[![License](https://img.shields.io/github/license/worldline-go/forward?color=red\u0026style=flat-square)](https://raw.githubusercontent.com/worldline-go/forward/main/LICENSE)\n[![Coverage](https://img.shields.io/sonar/coverage/worldline-go_forward?logo=sonarcloud\u0026server=https%3A%2F%2Fsonarcloud.io\u0026style=flat-square)](https://sonarcloud.io/summary/overall?id=worldline-go_forward)\n[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/worldline-go/forward/test.yml?branch=main\u0026logo=github\u0026style=flat-square\u0026label=ci)](https://github.com/worldline-go/forward/actions)\n[![Go PKG](https://raw.githubusercontent.com/worldline-go/guide/main/badge/custom/reference.svg)](https://pkg.go.dev/github.com/worldline-go/forward)\n\nExport socket connection to HTTP service with filter options.\n\n## Usage\n\nUse `LOG_LEVEL` and `LOG_PRETTY` env values to control the log level and format.\n\n```\nFlags:\n  -h, --help                 help for forward\n  -H, --host stringArray     Host to listen on (default [0.0.0.0:8080])\n  -s, --socket stringArray   Socket to export: /var/run/docker.sock:/:*,-POST,-PUT,-DELETE\n  -v, --version              version for forward\n```\n\nShow the lists of sockets to export with show http methods.\n\nHTTP methods could be any string(case insensitive), and starting with `-` will not allowed.\n\n```sh\n# allow all methods to / path\n/var/run/docker.sock\n\n# allow all except POST, PUT, DELETE with basepath /docker/\n/var/run/docker.sock:/docker/:-POST,-PUT,-DELETE\n\n# Only allow GET requests\n/var/run/docker.sock:/docker/:GET\n\n# Disable all methods of requests\n/var/run/docker.sock:/docker/:-*\n```\n\n```sh\nsudo ./forward -s '/var/run/docker.sock:/:-POST,-PUT,-DELETE'\n```\n\nIf you need multiple ports with multiple sockets than give name before prefix of `@`.\n\n```sh\nforward -H localhost@127.0.0.1:8082 -s 'localhost@/var/run/docker.sock'\n```\n\nUse `-H` and `-s` more than once to make connections.\n\n```sh\nforward -H localhost@127.0.0.1:8082 -s 'localhost@/var/run/docker.sock' -H share@0.0.0.0:8080 -s 'share@/var/run/docker.sock:/:-POST,-PUT,-DELETE'\n\n# 2024-09-07 21:01:45 CEST INF forward version: v0.0.0 commit: - buildDate:-\n# 2024-09-07 21:01:45 CEST INF localhost - route [/] to [/var/run/docker.sock]; allow: *; deny:\n# 2024-09-07 21:01:45 CEST INF share - route [/] to [/var/run/docker.sock]; allow: *; deny: DELETE,POST,PUT\n# 2024-09-07 21:01:45 CEST INF server share on [0.0.0.0:8080]\n# 2024-09-07 21:01:45 CEST INF server localhost on [127.0.0.1:8082]\n```\n\nIf program cannot access the socket, you will get `502 Bad Gateway` on every request.\n\n### Docker\n\nThere are scratch and alpine version of container image.\n\n```sh\ndocker run --rm -it -p 8080:8080 -v /var/run/docker.sock:/docker.sock ghcr.io/worldline-go/forward -s /docker.sock:/:-POST,-PUT,-DELETE,-PATCH\n```\n\n## Development\n\nLocal generate binary\n\n```sh\nmake build\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fworldline-go%2Fforward","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fworldline-go%2Fforward","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fworldline-go%2Fforward/lists"}