Giter VIP home page Giter VIP logo

echo-server's People

Contributors

ammit avatar arulrajnet avatar dependabot[bot] avatar gaal123 avatar jmalloc avatar marcofranssen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

echo-server's Issues

TLS support

The server should support serving HTTPS/WSS using a configurable cert chain. If no such configuration is provided it should generate a self-signed certificate on-the-fly.

An option to turn off CORS for HTTP

Hello! Thank you for this project.

I used it for comparing different requests I was making from vanilla fetch API and through a proxy service I do not have direct control over.

The problem I faced with was a CORS, because I worked with Electron-based app (which is a browser under the hood):

Access to fetch at 'http://localhost:8080/' from origin 'app://obsidian.md' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

To fix the error I've added the following line to serveHTTP:

wr.Header().Set("Access-Control-Allow-Origin", "*")
wr.Header().Set("Access-Control-Allow-Methods", "*")
wr.Header().Set("Access-Control-Allow-Headers", "*")

Consider adding those headers with an option you can configure on startup.

Publish image to GHCR

Is your feature request related to a problem? Please describe.

Hi ๐Ÿ‘‹๐Ÿผ In order to combat dockerhub's imposed rate limits it would be great to host these images on GHCR.

Describe the solution you'd like

Push echo-server to an additional registry like GHCR

Thanks!

Memory leak

Over time memory increases and eventually kills the container.

image

wss

wss from generated self signed cert/key or from mount folder with cert/key

Versions on DockerHub, in addition to "latest"?

Would you feel comfortable having version tags on DockerHub, in addition to latest? I don't expect the behavior will change radically, but I'm a bit more comfortable if dependencies are pinned.

Status code '403' when trying to connect to wss://ws.ifelse.io/ via C# WebSocketClient (from 'GitHub' action workflow env.)

Hi.
I am using your echo server (wss://ws.ifelse.io/) as a test to check my library for web-socket connection. The language is C# and I use .Net Framework 4.5 platform (there is some requirement to use deprecated stack). Internally I use ClientWebSocket and all works fine from my local PC.

But, as I call the same (just establish websocket connection ) from the GitHub workflow (I have some simple CI test automation on GutHub) I got the following error:

System.Exception: At method OpenConnection was occured exeption:The server returned status code '403' when status code '101' was expected.

I can't have any idea of what causing this behaviour. I looked at the source code and didn't find any that could cause this. So maybe any suggestions or ideas I would give here. Thanks

Give an example of PORT in readme?

Thanks for making this! This might be obvious, but I was confused at first when PORT by itself didn't work for me, but adding --publish fixed it. Maybe an example in the README of the correct usage?

$ docker run --detach -P -e PORT=80 --name echo1 jmalloc/echo-server
$ docker logs echo1
Echo server listening on port 80.
$ docker ps
CONTAINER ID        IMAGE                 COMMAND              CREATED             STATUS              PORTS                     NAMES
40d0d62870b4        jmalloc/echo-server   "/bin/echo-server"   30 seconds ago      Up 29 seconds       0.0.0.0:32995->8080/tcp   echo1
$ curl http://localhost:32995
curl: (52) Empty reply from server

$ docker run --detach --publish 11111:80 -e PORT=80 --name echo2 jmalloc/echo-server
$ docker ps
CONTAINER ID        IMAGE                 COMMAND              CREATED              STATUS              PORTS                             NAMES
114811d87923        jmalloc/echo-server   "/bin/echo-server"   7 seconds ago        Up 7 seconds        8080/tcp, 0.0.0.0:11111->80/tcp   echo2
40d0d62870b4        jmalloc/echo-server   "/bin/echo-server"   About a minute ago   Up About a minute   0.0.0.0:32995->8080/tcp           echo1
$ curl http://localhost:11111
Request served by 114811d87923

HTTP/1.1 GET /

Host: localhost:11111
User-Agent: curl/7.52.1
Accept: */*

Output shows a list of empty headers

Running this in a docker container and since the last update to 0.3.2, output shows as many empty header lines as actual headers (12 in this case)

image

Echoed request line out of order

In

fmt.Fprintf(w, "%s %s %s\n", req.Proto, req.Method, req.URL)
, the request line is echoed as HTTP-Version Method Request-URI, while the RFC https://www.rfc-editor.org/rfc/rfc2616#section-5.1 states it is Method Request-URI HTTP-Version

This confused me as I thought the reverse proxy I was trying to debug was mangling the request.

I realised when looking at the code that the line needs to be re-created from the request. I think it should be rebuilt in the expected order.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.