Discover Packages 
           
        
        
          
            git.sr.ht/~jswank/http-echo-server
           
          
            
               
          
        
       
     
   
  
    
  
    
       
    
    
      module 
    
    
      
        
           
      
    
   
    
      
  
    
      
  
    
      Version:  
        v0.2.0
     
    
      Opens a new window with list of versions in this module.
    
    
    
   
      
  
    Published: Feb 11, 2023
   
      
  
    License: MIT 
      
    
   
  
    Opens a new window with license information.
  
      
    
   
  
  
    
   
 
    
      
    
    
  
  
    
      
        
          README 
        
       
     
  
 
    
  
    
      
        
  
    
      ¶ 
     
    
      
        http-echo-server 
Echo information about an HTTP request.
Overview 
$ LISTEN_ADDR=:7070 ./http-echo-server 2>stderr 1>stdout &
[1] 4071874
$ curl -H "X-Header: badoop" http://localhost:7070/foo
GET /foo HTTP/1.1
Accept: */*
User-Agent: curl/7.86.0
X-Header: badoop
$ curl -H "X-Header: badoop" -X POST -d bar="baz" http://localhost:7070/foo
POST /foo HTTP/1.1
Accept: */*
Content-Length: 7
Content-Type: application/x-www-form-urlencoded
User-Agent: curl/7.86.0
X-Header: badoop
bar=baz%
$ cat stderr stdout
2023/02/02 11:00:30 starting http-echo-server on :7070
127.0.0.1 - - [02/Feb/2023:11:00:42 -0500] "GET /foo HTTP/1.1" 200 76
127.0.0.1 - - [02/Feb/2023:11:02:23 -0500] "POST /foo HTTP/1.1" 200 152
Install 
Locally:
$ go install git.sr.ht/~jswank/http-echo-server
Via Docker:
$ docker run jswank/http-echo-server:latest
Development 
Using casy/just :
$ just
Available recipes:
    build           # build the binary
    build-image     # build a docker image
    clean           # clean up
    clean-container # remove the container
    default         # list the just recipes
    run             # run the binary
    run-container   # run a container via docker-compose
License 
MIT
 
      Expand ▾ 
      Collapse ▴ 
    
   
      
      
      
      
        
  
      
     
   
   Click to show internal directories. 
   Click to hide internal directories.