[GH-ISSUE #494] [Feature request] Support HTTP connections in container #96

Closed
opened 2026-03-03 12:08:15 +03:00 by kerem · 3 comments
Owner

Originally created by @aochagavia on GitHub (May 6, 2021).
Original GitHub issue: https://github.com/fsouza/fake-gcs-server/issues/494

Problem

The Dockerfile only exposes an HTTPS port for connections, as you can see below:

github.com/fsouza/fake-gcs-server@4fd6c95bc5/Dockerfile (L13-L17)

While using HTTPS is not a problem when testing things using curl, it doesn't work well when using the SDK for C# (it refuses to establish a HTTPS connection without a valid certificate).

Proposed solution

Exposing an HTTP port would make it possible to use this project together with the C# SDK.

Btw, I looked around the code to see if it was easy to add, but I am not acquainted enough with Go and got lost :/

Originally created by @aochagavia on GitHub (May 6, 2021). Original GitHub issue: https://github.com/fsouza/fake-gcs-server/issues/494 ### Problem The `Dockerfile` _only_ exposes an HTTPS port for connections, as you can see below: https://github.com/fsouza/fake-gcs-server/blob/4fd6c95bc5dcd0555a40c04bcb984730ce22ddcc/Dockerfile#L13-L17 While using HTTPS is not a problem when testing things using curl, it doesn't work well when using the SDK for C# (it refuses to establish a HTTPS connection without a valid certificate). ### Proposed solution Exposing an HTTP port would make it possible to use this project together with the C# SDK. Btw, I looked around the code to see if it was easy to add, but I am not acquainted enough with Go and got lost :/
kerem 2026-03-03 12:08:15 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@fsouza commented on GitHub (May 7, 2021):

Hi @aochagavia, thanks for opening this issue. The EXPOSE command in Docker is mostly for documentation and some level of automation when publishing ports, you can publish any ports when starting the container, and fake-gcs-server already supports running with http instead of https, as long as you specify the -scheme flag.

So, adapting the example in the readme to use http + port 8080 would be something like:

% docker run -d --name fake-gcs-server -p 8080:8080 -v ${PWD}/examples/data:/data fsouza/fake-gcs-server -scheme http -port 8080
9df15988b68f8641a4ef7536385d87c2e5139b50d5ee48773af429a06619a2bb
% curl http://0.0.0.0:8080/storage/v1/b/sample-bucket/o
{"kind":"storage#objects","items":[{"kind":"storage#object","name":"some_file.txt","id":"sample-bucket/some_file.txt","bucket":"sample-bucket","size":"33","timeCreated":"2021-05-07T03:51:30.305433Z","timeDeleted":"0001-01-01T00:00:00Z","updated":"2021-05-07T03:51:30.305462Z","generation":"0"}]}

(port 4443 can be used with http too, it doesn't need to be used with https, so you could pass just -scheme http and curl http://0.0.0.0:4443/... instead)

<!-- gh-comment-id:834044374 --> @fsouza commented on GitHub (May 7, 2021): Hi @aochagavia, thanks for opening this issue. The `EXPOSE` command in Docker is mostly for documentation and some level of automation when publishing ports, you can publish any ports when starting the container, and fake-gcs-server already supports running with http instead of https, as long as you specify the `-scheme` flag. So, adapting the example in the readme to use http + port 8080 would be something like: ``` % docker run -d --name fake-gcs-server -p 8080:8080 -v ${PWD}/examples/data:/data fsouza/fake-gcs-server -scheme http -port 8080 9df15988b68f8641a4ef7536385d87c2e5139b50d5ee48773af429a06619a2bb % curl http://0.0.0.0:8080/storage/v1/b/sample-bucket/o {"kind":"storage#objects","items":[{"kind":"storage#object","name":"some_file.txt","id":"sample-bucket/some_file.txt","bucket":"sample-bucket","size":"33","timeCreated":"2021-05-07T03:51:30.305433Z","timeDeleted":"0001-01-01T00:00:00Z","updated":"2021-05-07T03:51:30.305462Z","generation":"0"}]} ``` (port 4443 can be used with http too, it doesn't need to be used with https, so you could pass just `-scheme http` and `curl http://0.0.0.0:4443/...` instead)
Author
Owner

@aochagavia commented on GitHub (May 7, 2021):

Hi @fsouza , thanks for the explanation. It seems like I missed the -scheme flag. Maybe it would be useful to have it mentioned on the readme.

By the way, thanks for this repository as well!

<!-- gh-comment-id:834176180 --> @aochagavia commented on GitHub (May 7, 2021): Hi @fsouza , thanks for the explanation. It seems like I missed the `-scheme` flag. Maybe it would be useful to have it mentioned on the readme. By the way, thanks for this repository as well!
Author
Owner

@fsouza commented on GitHub (May 7, 2021):

Oh, that's a good callout. Let me reopen this so we can track the doc change.

<!-- gh-comment-id:834284020 --> @fsouza commented on GitHub (May 7, 2021): Oh, that's a good callout. Let me reopen this so we can track the doc change.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/fake-gcs-server#96
No description provided.