ferret
ferret
Explore posts from servers
RRailway
Created by ferret on 3/23/2024 in #✋|help
Railway SvelteKit deploy doesn't match local configuration
No description
37 replies
RRailway
Created by ferret on 12/22/2023 in #✋|help
issue with prisma connecting to planetscale on railway
No description
9 replies
DIAdiscord.js - Imagine an app
Created by ferret on 11/8/2023 in #djs-questions
images in an embed don't load
No description
17 replies
RRailway
Created by ferret on 9/20/2023 in #✋|help
websocket: bad handshake with gorilla websockets
i have a websocket server running on railway with a custom domain, and when going to the websocket route in the browser, i get the expected error:
Bad Request
websocket: the client is not using the websocket protocol: 'upgrade' token not found in 'Connection' header
Bad Request
websocket: the client is not using the websocket protocol: 'upgrade' token not found in 'Connection' header
so i think the server is exposed correctly. however, when connecting using my cli app with the gorilla websockets package, i get this error:
2023/09/19 18:30:04 websocket: bad handshake
exit status 1
2023/09/19 18:30:04 websocket: bad handshake
exit status 1
i'm not entirely sure why. code for connecting:
package client

import (
"fmt"
"net/url"
"os"
"os/signal"

"github.com/gorilla/websocket"
)

type StartRequest struct {
MetaApiKey string `json:"META_API_KEY"`
RiskPercent float64 `json:"RISK_PERCENT"`
AccountId string `json:"ACCOUNT_ID"`
BrokerSuffix string `json:"BROKER_SUFFIX"`
}

func Connect() (*websocket.Conn, chan struct{}, error) {
interrupt := make(chan os.Signal, 1)

signal.Notify(interrupt, os.Interrupt)

u := url.URL{Scheme: "ws", Host: os.Getenv("SERVER_HOST"), Path: "/websocket"}

fmt.Println(u.String())

c, _, err := websocket.DefaultDialer.Dial(u.String(), nil)

if err != nil {
return &websocket.Conn{}, make(chan struct{}, 0), err
}

done := make(chan struct{}, 1)

go func() {
<-done

c.Close()
}()

return c, done, nil
}
package client

import (
"fmt"
"net/url"
"os"
"os/signal"

"github.com/gorilla/websocket"
)

type StartRequest struct {
MetaApiKey string `json:"META_API_KEY"`
RiskPercent float64 `json:"RISK_PERCENT"`
AccountId string `json:"ACCOUNT_ID"`
BrokerSuffix string `json:"BROKER_SUFFIX"`
}

func Connect() (*websocket.Conn, chan struct{}, error) {
interrupt := make(chan os.Signal, 1)

signal.Notify(interrupt, os.Interrupt)

u := url.URL{Scheme: "ws", Host: os.Getenv("SERVER_HOST"), Path: "/websocket"}

fmt.Println(u.String())

c, _, err := websocket.DefaultDialer.Dial(u.String(), nil)

if err != nil {
return &websocket.Conn{}, make(chan struct{}, 0), err
}

done := make(chan struct{}, 1)

go func() {
<-done

c.Close()
}()

return c, done, nil
}
19 replies
RRailway
Created by ferret on 8/4/2023 in #✋|help
trouble exposing a go app
33 replies
RRailway
Created by ferret on 7/30/2023 in #✋|help
build stuck at initializing
10 replies
RRailway
Created by ferret on 7/17/2023 in #✋|help
flask css error
18 replies
RRailway
Created by ferret on 7/17/2023 in #✋|help
custom domain not working
13 replies
RRailway
Created by ferret on 1/11/2023 in #✋|help
Question about how logs are gathered
I have a question about how logs are gathered on railway. I have a k8s cluster where user pods are dynamically configured in a new namespace, and I'd like to run a sidecar pod that intercepts logs from another container in the same pod. So far, I haven't found a way to grab the logs from another running container. I'd like to know if railway does something similar
4 replies
RRailway
Created by ferret on 9/21/2022 in #✋|help
Question About Railway & Nixpacks
Hey all, I think nixpacks is super interesting and I'm looking to integrate it in my own project, but I'm confused about how I want to implement it. I'm working on my own hosting platform for fun. I'm running a Kubernetes cluster that has all the microservices for the platform. I have a deployment microservice where I'd like to build a Docker image using nixpacks and run it. I was curious about how Railway integrated nixpacks into the deployment pipeline and was wondering if anyone could share some insight. Thanks in advance 🙂
18 replies