Questions tagged [mux]

Package gorilla/mux implements a request router and dispatcher for matching incoming requests to their respective handler.

331 questions
3
votes
1 answer

Handling dynamic sub-domains

Let's say my website is http://soccer.com and I want to support an unlimited amount of subdomains, eg.: http://cronaldo.soccer.com http://messi.soccer.com http://neymar.soccer.com http://muller.soccer.com ... I also want to have a few reserved…
Cornwell
  • 3,304
  • 7
  • 51
  • 84
3
votes
1 answer

Gorilla Mux Google Cloud Endpoints CORS Issues

I'm trying to build an API using gorilla mux and google cloud endpoints but am having trouble getting it to allow cross origin requests. I'm using the following code in my web application to send the requests: $.ajax("https://my.api/echo", { …
3
votes
1 answer

Gorilla Mux 404

I'm taking this holiday break to freshen up on Go. Unfortunately the code I have below is throwing a 404 on both of the routes. This is the latest iteration. I originally had the router in a handleRouter function and thought taking it out would fix…
Quesofat
  • 1,493
  • 2
  • 21
  • 49
3
votes
3 answers

Undefined: App with mux

So I just started learning Go yesterday and I have been following a fairly simple tutorial on creating a restful api. I can run the tests and everything but when I try to run the app and have it listen on a part it gives me undefined: App. I cannot…
Mr.Smithyyy
  • 2,157
  • 12
  • 49
  • 95
3
votes
1 answer

golang preflight request error

I have set up my Go backend using gorilla/mux and rs/cors. When I try to send a request including a custom header (Bearer) it fails. My server setup looks like this: router := mux.NewRouter().StrictSlash(true) router.HandleFunc("/users",…
Dylan Meeus
  • 5,696
  • 2
  • 30
  • 49
3
votes
1 answer

Run middleware after Gorilla mux handling

I'm trying to use Golang middleware to run after handling Gorilla Mux routing, in order to change the response of each request. Code sample see below. Currently it returns 'run before, run test', goal is to return 'run before, run test, run after'…
bertt
  • 427
  • 1
  • 5
  • 11
3
votes
2 answers

using a conditional variable which is defined later in verilog

Suppose I have the following instantiation first_mux_input=top.middle.down[i]; second_mux_input=top.middle.down[i+1]; assign down = (select[i])? first_mux_input:second_mux_input; supposing there are a lot of muxes and their outputs go to the…
3
votes
2 answers

Get 301 status code when sending GET request with parameter

I have a very simple Go server code setup with mux and when I use curl with GET request params (localhost:8080/suggestions/?locale=en), I get 301 status code (Move permanently). But when there's no get parameters, it's working just fine. func main()…
Victor Pham
  • 63
  • 13
3
votes
0 answers

FFMpeg muxing h264 to mp4 resultant file is not running

I am writing code to mux h264 file into mp4 by using latest FFMPEG 3.0. Muxing is working but the resultant mp4 file is not showing vedio, only the time is running when i play the resultant mp4 file. Kindly try to help to solve this. Please tell me…
M.Taha
  • 31
  • 4
3
votes
2 answers

Configuration of JPOS QMUX

I am new in JPOS. I need some help. Please find below my requirement. In TCP connection terms, the IST Switch is configured to be a Server and the MPOS server is configured to be a Client. MPOS server and IST Switch should communicate via a single…
gufran91
  • 67
  • 1
  • 11
3
votes
1 answer

Golang - Github Mux, context.go -> No such file or directory

I want to install the Mux package with (go get github.com/gorilla/mux) but I always get the errormessage # github.com/gorilla/context open go/src/github.com/gorilla/context/context.go: No such file or directory I have created the directories…
fnr
  • 9,007
  • 5
  • 17
  • 16
3
votes
3 answers

Creating a generic multiplexer

I want to create a generic multiplexer, meaning it can have a variable number of inputs and variable data_width. This means that for declaring the data input I need an array which would look like this: type data is array(entries-1 downto 0) of…
user2971971
  • 183
  • 6
  • 11
3
votes
1 answer

Running two web server at the same time in one go programm

In a go program, I want to run two web servers at the same time, obviously they will be serving on two different ports (and ip addresses if necessary), the problem is with the call to http.handle, when I try to register handler for '/' for the…
Ali
  • 18,665
  • 21
  • 103
  • 138
3
votes
1 answer

No response from gorilla/rpc JSON RPC Service

I'm investigating using the gorilla web toolkit to create a simple RPC API. I'm using the example from their documentation and I'm testing using Advanced Rest Client in Chrome and use http://localhost:1111/api/ and POST the following RAW JSON…
Mattl
  • 1,588
  • 3
  • 24
  • 49
2
votes
1 answer

Serving static files recursively with go

I'm using sveltekit as my frontend for an app I'm working on. I've chosen a static adapter in the svelte.config.js which outputs all necessary components as static files. Here is the structure of my static directory. The upper most files load,…
Brandon Kauffman
  • 1,515
  • 1
  • 7
  • 33