Skip to content
This repository has been archived by the owner on Jul 13, 2021. It is now read-only.

Option to set websocket path #105

Open
bryanlarsen opened this issue Oct 25, 2018 · 6 comments
Open

Option to set websocket path #105

bryanlarsen opened this issue Oct 25, 2018 · 6 comments

Comments

@bryanlarsen
Copy link

Feature Use Case

Using webpack-hot-client under some sort of orchestration system to tie together a bunch of microservers, like an ingress server in minikube or the kubernetes in docker-for-mac

Feature Proposal

Allow the websocket path to be specified both on the client and the server. I'd prefer they both be set the same so I don't need to use url-rewriting.

Current ugly workaround

setting options:

host: {
    server: '0.0.0.0',
    client: 'localhost/hot',
},
port: 3002

and useing the ingress:

---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: hot
  annotations:
    kubernetes.io/ingress.class: "nginx"
    ingress.kubernetes.io/ssl-redirect: "false"
    nginx.org/websocket-services: "app"
    nginx.ingress.kubernetes.io/rewrite-target: '/'
spec:
  rules:
  - http:
      paths:
        - path: /hot:3002
          backend:
            serviceName: app
            servicePort: 3002

It's an ugly hack, but by setting host.client to 'localhost/hot', the resulting url is 'ws://localhost/hot:3002'

@alexander-akait
Copy link
Member

@bryanlarsen do you use webpack-serve? If yes, webpack-serve deprecated

@bryanlarsen
Copy link
Author

I'm using koa-webpack.

@alexander-akait
Copy link
Member

@bryanlarsen doesn't support officially

@bryanlarsen
Copy link
Author

koa-webpack is just a thin shim over webpack-serve, so I don't mind using it directly if that helps.

@ozyman42
Copy link

What is the correct way to use this package? With webpack-dev-server?

@j-walker23
Copy link

@alexleung The opposite. Was created to replace WDS when it got stagnant. But then it got going again. Well webpack-serve was, and this is it's HMR package, counterpart to WDS's webpack-hot-middleware.

At least i think i got all that right. I just started with this stuff yesterday and am still failing at getting HMR running for an app that has a non javascript backend (python).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants