via

Simple pubsub server inspired by https://patchbay.pub/
git clone https://git.ce9e.org/via.git

commit
87bca7e07eed9ad5e15f54d9ada65a4aa84a9e69
parent
4f0e2f4644cca27d5f3758d6adc139325bf02dd9
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2020-05-05 04:12
rm host command line arg

Diffstat

M README.md 2 +-
M via.go 9 +++------
M via.service 2 +-

3 files changed, 5 insertions, 8 deletions


diff --git a/README.md b/README.md

@@ -9,7 +9,7 @@ This is very much inspired by <https://patchbay.pub/> and its clones
    9     9 
   10    10 Start the server:
   11    11 
   12    -1 	via [-v] [[host]:port]
   -1    12 	via [-v] [port]
   13    13 
   14    14 Then start sending requests on the client:
   15    15 

diff --git a/via.go b/via.go

@@ -1,6 +1,6 @@
    1     1 // Simple pubsub server inspired by https://patchbay.pub
    2     2 //
    3    -1 // Usage: via [-v] [[host]:port]
   -1     3 // Usage: via [-v] [port]
    4     4 // curl http://localhost:8001/someid  # server sent event stream
    5     5 // curl http://localhost:8001/someid -d somedata
    6     6 //
@@ -174,7 +174,7 @@ func handler(w http.ResponseWriter, r *http.Request) {
  174   174 
  175   175 func main() {
  176   176 	flag.Usage = func() {
  177    -1 		fmt.Fprintf(os.Stderr, "via [-v] [[host]:port]\n")
   -1   177 		fmt.Fprintf(os.Stderr, "via [-v] [port]\n")
  178   178 		flag.PrintDefaults()
  179   179 	}
  180   180 
@@ -183,10 +183,7 @@ func main() {
  183   183 
  184   184 	addr := "localhost:8001"
  185   185 	if len(flag.Args()) > 0 {
  186    -1 		addr = flag.Args()[0]
  187    -1 	}
  188    -1 	if addr[0] == ':' {
  189    -1 		addr = "localhost" + addr
   -1   186 		addr = fmt.Sprintf("localhost:%s", flag.Args()[0]
  190   187 	}
  191   188 
  192   189 	http.HandleFunc("/", handler)

diff --git a/via.service b/via.service

@@ -4,7 +4,7 @@ After=network.target
    4     4 
    5     5 [Service]
    6     6 Type=simple
    7    -1 ExecStart=/usr/bin/via localhost:8001
   -1     7 ExecStart=/usr/bin/via 8001
    8     8 Restart=always
    9     9 DynamicUser=yes
   10    10 ProtectSystem=strict