Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
52 views

Gorilla Websocket WriteMessage leading Out of memory on using WriteBufferPool

I've upgraded to websocket with following upgrader var upgrader = websocket.Upgrader{ ReadBufferSize: 1024, WriteBufferPool: &writeBufferPool, EnableCompression: false, } var ...
Sanket Bijawe's user avatar
1 vote
1 answer
31 views

Golang: gorilla - how to handle requests to endpoint defined with url parameter when the parameter is empty

I have this endpoint definition: router.NotFoundHandler = http.HandlerFunc(handlerNotFound) router.HandleFunc("/customer/{id}", handlerCustUpd).Methods(http.MethodPut) When called URL https:...
Katzman's user avatar
  • 21
1 vote
0 answers
22 views

subrouting with mux leads to 404

i am trying to create subroutes for my app with gorilla mux this is my router package: type IRouter interface { Get(uri string, f func(w http.ResponseWriter, r *http.Request)) Post(uri string, ...
saeed's user avatar
  • 89
1 vote
1 answer
32 views

Managing Gorilla WebSocket Connections in a Real-Time Application

I'm currently working on a real-time application that utilizes Gorilla WebSocket in conjunction with Next.js. One of the challenges I'm facing is that when a user refreshes the page, a new WebSocket ...
addcommitpush's user avatar
1 vote
1 answer
47 views

Why can't I chain a `Use()` with `HandleFunc()` while setting up middleware in Gorilla/mux?

I am trying to add a simple user ID validation middleware to a route like so: api package contains: func RegisterUserRoutes(router *mux.Router) { router.HandleFunc("/{id}/follower/{...
Vineet Kalghatgi's user avatar
2 votes
1 answer
137 views

Authorization Error in API Gateway endpoints using lambda with Chalice code

Here is the scenario: I had a Chalice app with two endpoints /getStream and /deleteStream. I migrated them to Nextjs functions eliminating the need for a Chalice app. So, I deleted the API Gateway ...
Amit's user avatar
  • 1,115
1 vote
1 answer
60 views

404 Not Working With React App on Golang Server [duplicate]

My Redirection works perfectly when running reactjs app in development environment (npm run dev), proper redirect to home. But when i serving same app on golang, after npm run build, redirection doesn'...
huzaib sayyed's user avatar
2 votes
0 answers
154 views

Unable to retrieve session value in Go Gin

Problem: The session data set during login is not persisting across subsequent requests. Expected output: The session data set during login should be stored and is accessible persist requests. func (...
Diwash Mainali's user avatar
0 votes
0 answers
280 views

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at.... CORS preflight response did not succeed

So, I'm creating a reactjs page where I want to consume a Golang Gorilla Mux api. But whenever I call the api this way: fetch('http://localhost:8080/commands/', { method: 'POST', ...
P2000Gua's user avatar
1 vote
2 answers
96 views

CORS Error: It does not have HTTP ok status. GoLang Mux API

I'm trying to make http requests via Angular 17 App. And everytime the browser responds: Access to XMLHttpRequest at 'http://localhost:8082/login' from origin 'http://localhost:4200' has been blocked ...
rafaelpadu's user avatar
  • 1,584
1 vote
1 answer
134 views

grpc-gateway: Context being passed to http handler losing values set on context

I'm at a loss with what is going on with my context between my GRPC handler and it calling gwmux.ServeHTTP(w, r.WithContext(ctx) I've stripped out a lot of the code to try and only include the bare ...
Kyle's user avatar
  • 1,472
0 votes
0 answers
62 views

Websocket write doesn't fail even if the network connection is broken [duplicate]

I have a websocket connection to another server in a different network and I keep sending data to it using the gorilla websocket lib's WriteMessage method. https://github.com/gorilla/websocket/blob/...
nerd's user avatar
  • 23
1 vote
1 answer
72 views

Prepoluting index page before mux Handle call

I recently built a small blog website for testing purposes and I'm a little stuck with this problem while writing the server in Go. I have all the files of the website inside the static folder, which ...
NicolaM94's user avatar
  • 141
1 vote
0 answers
76 views

Incorrect message sending to Centrifuge

Please help me solve the error. I have a Docker container with Centrifuge. I need to send messages to the 'user' channel. Everything should happen on the backend side - without involving the browser. ...
Jenny F's user avatar
  • 31
2 votes
2 answers
530 views

Gorilla session package error : "securecookie: hash key is not set"

I created an HTTP API to register with the GIN HTTP package and Gorilla Sessions. But I get an error message like the following: "error": "securecookie: hash key is not set" here ...
Hello 123's user avatar
-1 votes
1 answer
353 views

TypeScript Error: "Expected 0-1 arguments, but got 2" when initializing Mux object

I'm using TypeScript with the Mux library for video handling in my application. As per the documentation, I'm attempting to initialize a Mux object with the required token ID and token secret obtained ...
Dede's user avatar
  • 11
1 vote
1 answer
55 views

Handling the upgrade of a request client-side

I'm probably being stupid here, but I am upgrading a HTML Request to a WS, with Gorilla Mux, and can't seem to figure out how to access the WebSocket on the Webpage after upgrade, func loadSecureThing(...
Kestrel Kosdlic's user avatar
1 vote
0 answers
151 views

Error fetching data: SyntaxError: Unexpected end of JSON input at JSON.parse (<anonymous>)

im having problems with gorilla sessions mainly, but with nextjs and frontend too, i can fetch all my data with no problem, but when i try to send the user to the front end from the gorilla session ...
vfreis09's user avatar
0 votes
0 answers
282 views

Golang gorilla websocket server refusing further connections after accepting approximately 16,300 concurrent connections

I am running Ubuntu Server 22.04 on a virtual machine with a configuration of 16 CPUs and 32GB of RAM. On this virtual machine, I have deployed a Golang server using Gorilla WebSocket with the goal of ...
Imoh Chinedu's user avatar
0 votes
1 answer
38 views

Manually deleting val from context map using Gorilla middleware

Do I need to do this: r.Use(func(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { muxctx.Set(r, "req-res-ctx", &mw.Ctx{...
Alexander Mills's user avatar
1 vote
1 answer
364 views

How to implement http.Hijacker using Gorilla Websockets & alexedwards/scs/v2

Recently upgraded the excellent alexedwards/scs/v2 within a Go webapp from 2.5.0 to 2.7.0 to allow for Go 1.20+ support for http.NewResponseController(). Subsequently to allow for extending handler ...
RetroRocker's user avatar
1 vote
1 answer
71 views

Trouble serving JavaScript and asset files with Gorilla Mux in Golang

I have file system like this: -- api -> api.go -- styles -> style1.css -> style2.css -> ... -- scripts -> script1.js -> script2.js -> ... -- ...
Mudia's user avatar
  • 57
-3 votes
2 answers
661 views

How to get value of url inside a function in golang [closed]

I have this router function with mux: func InitRouter() { r := http.NewServeMux() r.HandleFunc("/{id}", getWords) log.Fatal(http.ListenAndServe(":8000", r)) } I want ...
Haroune's user avatar
  • 13
0 votes
1 answer
106 views

How to read only the first X bytes of a message using Golang

Say I have some WS code like so: var upgrader = websocket.Upgrader{ ReadBufferSize: 1024, WriteBufferSize: 1024, } func handleConnections(w http.ResponseWriter, r *http.Request) { ws, ...
Alexander Mills's user avatar
1 vote
2 answers
303 views

Error getting the body with middleware in Golang

I am creating an endpoint and I am using the JSONContentExtractor middleware to obtain the context, but if I use it I cannot obtain the Body in the handler. package main import ( "encoding/json&...
Arely Chávez's user avatar
3 votes
1 answer
1k views

Get trace_id from OTEL trace instrumented with golang otelmux

In my golang application, I've instrumented OTEL tracing middleware with otelmux middleware and ddotel tracer provider: package tracing import ( "github.com/gorilla/mux" "go....
Alechko's user avatar
  • 1,568
0 votes
0 answers
169 views

Golang Websocket Interact: error: Invalid WebSocket frame: RSV2 and RSV3 must be clear

When i am trying to connect through websocket, i am getting this error - Invalid WebSocket frame: RSV2 and RSV3 must be clear using wscat. When i used HTML which is provided bellow, it give error in ...
huzaib sayyed's user avatar
0 votes
1 answer
143 views

C++ LibAV muxing raw H264 into MP4 container and keeping on the buffer

I have an array of raw H264 AVPackets which get from IP Camera's RTSP. so I'm going to put them into MP4 container (not to the file into the buffer) then stream the buffer on the network. I read ...
Ehsan Vahab's user avatar
1 vote
0 answers
210 views

Setting cookies client side in Golang

Good morning everyone, I'm trying to build a test web-app with Go, but I can't seem to find a way to properly set the cookies. I'm using the securecookie function from gorilla package, and it works ...
NicolaM94's user avatar
  • 141
0 votes
0 answers
2k views

How to solve write: broken pipe on websocket?

I'm making a progress bar for my program, and send it to client. The IPC I used is websocket. But I'm facing write: broken pipe when updating progress bar to the client. This error occurs after the ...
newtocoding's user avatar
2 votes
1 answer
572 views

Golang Mux Router CORS Error when Adding Credentials to Request

I simply need to allow for credentials in my Go Mux router. It seems like it should be pretty straight forward. As soon as I set withCredentials to true in my axios interceptor, I only get CORS errors....
LUKER's user avatar
  • 494
0 votes
0 answers
785 views

How to play an IPTV live stream without an extension using Next.js?

I'm currently working on a Next.js project where I'm trying to create a video player to stream live IPTV feeds. The URLs of the streams I'm working with don't have an extension and don't use a ...
Serial Geeker's user avatar
1 vote
1 answer
133 views

Why does mux.Vars() returns empty map[]

I get an empty map[] from mux.Vars[]. After tracing the problem, it seems to be an empty map[] passed through my multiple files. While in the same file: I have imported the other file as a module(I ...
Ny0ttt's user avatar
  • 37
1 vote
0 answers
70 views

Logout Only Works After Go Restart

Problem Details and Results I really really do not understand what is wrong here and how to fix it. So, my goals are: All projects are showing when there are no user logged in, BUT, the edit and ...
bolderphil's user avatar
2 votes
0 answers
34 views

MongoDB connection getting terminated for a Post function

I have written a backend in Go for basic CRUD application. While working with Post function which can store images and other information in my DB the connection is getting terminated. This is what ...
Harshit Joshi's user avatar
2 votes
1 answer
894 views

WebSocket returning 403 every time

I'm not sure why this error keeps occurring but when I try connecting in my web browser it fails and returns 403, but it doesn't make sense since no where in my code I specifically told it to return ...
xLeki's user avatar
  • 79
2 votes
0 answers
276 views

Redis is not showing as a dependency in Elastic apm

I am using Elastic apm to monitor my go application.I use gorilla mux framework and redis db.I have integrated elastic apm with my code but I am not sure how to add redis as a dependency in elastic ...
Lancy Joy Lobo's user avatar
1 vote
0 answers
201 views

React Native Video using Mux

Currently I am using the Mux enter link description here for video playing inside the flatlist. Also I had pass the required props for optimizing the flatlist. But in some device video is loading and ...
Ankit Vora's user avatar
3 votes
1 answer
101 views

golang: github/gorilla/mux supports regression url path

When I want url path works well, with tail "/", and without tail "/" mux1 *mux.Router mux1.Handle("/example/", ...).Methods("GET") I want these 2 urls ...
郭佰胜's user avatar
1 vote
1 answer
161 views

How do I print the url path without parameters?

I have a RESTful API using Gorilla/mux. It is parameterized in the path. I am creating it as such: r := mux.NewRouter() subr := r.PathPrefix("/v1").Subrouter() subr.Handle("/...
cbll's user avatar
  • 7,059
2 votes
1 answer
159 views

How to get response only for a specific path/endpoint?

router.HandleFunc("/v1/m/mailboxes", s.handleGetAllMailboxes()).Methods(http.MethodGet) func (s *Server) handleGetAllMailboxes() http.HandlerFunc { return func(w http.ResponseWriter, r *...
Zitronenbonbon's user avatar
2 votes
0 answers
255 views

How do i pass multiple params to the gorilla mux router endponit?

I am getting error like " cannot refer to unexported name controllers.GetProducts" when passing more than one param in the below routing endpoint. Am i doing anything wrong below? func main()...
John Scott's user avatar
2 votes
1 answer
859 views

Use MUX Player (Video) in Angular 14/15

Mux is a video API service that has its own player: MUX Player I am wanting to use this npm package in Angular 14/15 by importing it into a specific component only. The js should only be loaded when ...
Luke's user avatar
  • 565
1 vote
0 answers
30 views

How to access another user's session in Gorilla Session store?

I'd like to let moderators to remove a banned user's session, so that he can not post anymore. But what I see in the gorilla/sessions documentation is the scenario where you can get session from ...
blnks's user avatar
  • 1,111
1 vote
2 answers
258 views

Adding query parameters when using Gorilla mux

I'm learning REST API development with go and cant figure out how to go about getting user specific documents. My use case is a typical get request that can fetch all the documents in a slice. However ...
Black Eyed Beans's user avatar
0 votes
0 answers
43 views

Websockets and management of different unrelated data

I am looking for a bit of guidance here, as after spending lots of time browsing various tutorials and SO answers, I have failed to find something that would help me move forward, although what I want ...
John Doe's user avatar
  • 1,152
2 votes
1 answer
560 views

How to combine mux (gorilla) in Go?

I have the following code in which I have two mux, one for unauthenticated routes (r) and another for authenticated routes (chain). I want to combine these two and serve. package main import ( &...
Sushant's user avatar
  • 133
3 votes
0 answers
645 views

Created an API but getting 511 network authentication error at client end

I am trying to create a simple web app, where I am using Go to create the backend and svelte to create the frontend. Backend is hosted on port 8080 and frontend on 5173. I used a node package '...
Mainak Bhattacharjee's user avatar
2 votes
0 answers
373 views

Why i can't connect to gorilla websocket server from front page?

backend code: func WsHandler(c *gin.Context) { upgrader.CheckOrigin = func(r *http.Request) bool { return true } conn, err := upgrader.Upgrade(c.Writer, c.Request, nil) if err !...
THJA JUNGLE's user avatar
1 vote
1 answer
713 views

Adding to GET the same endpoint with POST and different Queries ends up with inconsistent error messages

When adding the same routes with different methods, and per method queries the response of a get call is different, however since the other method is POST it should be unaffected. With POST: ...
Ivasan's user avatar
  • 147

1
2 3 4 5
13