{"id":19964363,"url":"https://github.com/bu-ist/bu-elb-simulator","last_synced_at":"2025-05-03T23:30:28.739Z","repository":{"id":65596127,"uuid":"145911109","full_name":"bu-ist/bu-elb-simulator","owner":"bu-ist","description":"An Elastic Load Balancer simulator with SSL termination","archived":false,"fork":false,"pushed_at":"2019-08-06T21:03:19.000Z","size":10,"stargazers_count":3,"open_issues_count":0,"forks_count":4,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-04-07T22:51:11.724Z","etag":null,"topics":["aws","docker","elb","local-development","local-only","ssl"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bu-ist.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-08-23T21:54:53.000Z","updated_at":"2023-06-29T17:03:27.000Z","dependencies_parsed_at":"2023-01-31T02:25:11.482Z","dependency_job_id":null,"html_url":"https://github.com/bu-ist/bu-elb-simulator","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bu-ist%2Fbu-elb-simulator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bu-ist%2Fbu-elb-simulator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bu-ist%2Fbu-elb-simulator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bu-ist%2Fbu-elb-simulator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bu-ist","download_url":"https://codeload.github.com/bu-ist/bu-elb-simulator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252269026,"owners_count":21721239,"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":["aws","docker","elb","local-development","local-only","ssl"],"created_at":"2024-11-13T02:23:06.236Z","updated_at":"2025-05-03T23:30:28.416Z","avatar_url":"https://github.com/bu-ist.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Elastic Load Balancer Simulator\n\nThis docker image tries to simulate the behavior of Amazon ELB and can be used\nto locally debug the webserver ECS containers that run behind ELB.\n\nThis image also can be used as SSL terminating proxy. By default, it will generate\na self-signed certificate for `localhost`.\nThis, along with other options, can be changed by setting environment variables.\n\n\n## Environment Variables\n\nVariable name | Default value\n--------------|------------------------\nREMOTE_URL    | -\nCERT_CN       | localhost\nDNS_RESOLVER  | auto\n\n\n## Sample Usage\n\n#### Using `docker`\n\nThe command below assumes that you have a local webserver running on port 5000\nbut you want to be able to access it via \neither http://localhost or https://localhost instead.\n```\ndocker run --rm -p 443:443 -p 80:80 -e REMOTE_URL=http://host.docker.internal:5000 bostonuniversity/elb-simulator:latest\n```\n\n#### Using `docker-compose`\n\nThe config below assumes that you have a service named `http_webserver`\nrunning on port 8000 but you want to be able to access it via \neither http://localhost or https://localhost instead.\n```\nversion: \"3.7\"\n\nservices:\n  elb:\n    image: bostonuniversity/elb-simulator:latest\n    ports:\n      - \"80:80\"\n      - \"443:443\"\n    environment:\n      REMOTE_URL: \"http://http_webserver:8000\"\n    depends_on:\n      - \"http_webserver\"\n\n  http_webserver:\n  ...\n```\n\n\n## Troubleshooting\n\n#### Missing Resolver\n\nSometimes, you may see something like this in the ouput:\n\n\u003e recv() failed (111: Connection refused) while resolving, resolver: 127.0.0.11:53\n\nThis indicates that the image failed to determine what IP to use as DNS resolver.\nThere are two possible remedies in this situation:\n\n1. Use the DNS resolver that was configured for your container.\n    To find the address of the resolver, run: \n    ```\n    docker run --rm bostonuniversity/elb-simulator:latest cat /etc/resolv.conf\n    ```\n\n    In the output, find the line that starts with `nameserver`\n    and then pass that IP as the `DNS_RESOLVER` environment variable to the container:\n    ```\n    docker run --rm -p 443:443 -p 80:80 -e REMOTE_URL=http://host.docker.internal:5000 -e DNS_RESOLVER=192.168.100.1 bostonuniversity/elb-simulator:latest\n    ```\n\n1. Force the creation of the DNS resolver on 127.0.0.11 \n    by running your docker container inside the custom network.\n    First, create the network:\n    ```\n    docker network create local\n    ```\n\n    Then, pass it as `--net` parameter when running the container:\n    ```\n    docker run --rm -p 443:443 -p 80:80 -e REMOTE_URL=http://host.docker.internal:5000 -e DNS_RESOLVER=127.0.0.11 --net=local bostonuniversity/elb-simulator:latest\n    ```\n\n\n## Persist generated certificate\n\nThe container checks if the file `/ssl/cert.crt` exists and regenerates the\ncertificate if it doesn't. This may cause issues if you're planning to install\nthis certificate into your OS to avoid security warnings in browsers.\n\nMount a volume into `/ssl` in your container. This way, even after rebuilding\nthe container, you'll keep using the same certificate.\n\n#### Using `docker`\n\n```\ndocker run --rm -p 443:443 -p 80:80 -e REMOTE_URL=http://host.docker.internal:5000 -v $(pwd)/ssl:/ssl bostonuniversity/elb-simulator:latest\n```\n\n#### Using `docker-compose`\n\n```\nversion: \"3.7\"\n\nservices:\n  elb:\n    image: bostonuniversity/elb-simulator:latest\n    ports:\n      - \"80:80\"\n      - \"443:443\"\n    environment:\n      REMOTE_URL: \"http://http_webserver:8000\"\n    depends_on:\n      - \"http_webserver\"\n    volumes:\n      - ./ssl:/ssl\n\n  http_webserver:\n  ...\n```\n\n### Install certificate into your OS\n\nFor Mac, run:\n```\nsudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain ./ssl/cert.crt\n```\n\nFor Windows, double click on the `cert.crt` file, then:\n```\nNext \u003e Place all certificates in the following store \u003e Trusted Root Certificate Authorities.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbu-ist%2Fbu-elb-simulator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbu-ist%2Fbu-elb-simulator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbu-ist%2Fbu-elb-simulator/lists"}