webpack-hot-client
webpack-hot-client copied to clipboard
Option to set websocket path
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'
@bryanlarsen do you use webpack-serve? If yes, webpack-serve deprecated
I'm using koa-webpack.
@bryanlarsen doesn't support officially
koa-webpack is just a thin shim over webpack-serve, so I don't mind using it directly if that helps.
What is the correct way to use this package? With webpack-dev-server?
@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).