Comments (8)
Not a middleware issue; But it sounds like #24
Check following examples on how to configure https correctly, since you are trying to open a secure websocket connection (wss:):
https://github.com/nodejitsu/node-http-proxy/blob/master/examples/http/
from http-proxy-middleware.
I added agent: "https.globalAgent",But still not work
from http-proxy-middleware.
You are trying to connect to: wss://192.1.10.80:2301/ws
Is the wss://
really needed? Try ws://
Also the proxy is configured to listen to path /socket
only.
Since you are connecting to the /ws
path; the proxy will not do anything.
from http-proxy-middleware.
@chimurai I plan to use 'websocket' connect wss://cloud.vanwardsmart.com:2301/ws ,but the server does not allow different Origin!
So I want to use http-proxy-middleware in gulpfile.But I have set in many way but still it dosen't work.
Can you give me a good example???THx !THx !THx! THx!
from http-proxy-middleware.
Can you send log output from HPM?
Add the option logLevel
and set it to debug
What is 192.1.10.80:2301
btw?
Is that your gulp server? If so, is it running on http or https?
from http-proxy-middleware.
@chimurai I don't know it is gulp server, I run 'ionic serve' to run it ,and it's http
Can you leave a email address to let me send my code to you so that you can check it easy ?
from http-proxy-middleware.
I don't think this is the right place for troubleshooting your application/development setup;
StackOverflow would be a better place for that.
Some pointers in your setup:
- make sure // are correctly configured in your client code:
var ws = new WebSocket('wss://192.1.10.80:2301/ws');
versusvar ws = new WebSocket('ws://192.1.10.80:2301/ws');
(no secure socket) - option
agent: https.globalAgent
is probably needed if you are proxying to ahttps:
target. - use option
pathRewrite
if the path need be changed from/ws
to/socket
- if you client connects to path
ws
, the proxy should also be configured to the same path.
from http-proxy-middleware.
Don't mind if you need help with HPM configuration.
But please use StackOverflow for your project setup.
from http-proxy-middleware.
Related Issues (20)
- POST request looses body HOT 2
- Unable to output console.log and my plugin is not running HOT 4
- v3 Next.js API Route Websocket multiple requests HOT 3
- Shadow/mirror requests HOT 2
- Express multipart/form-data multer files HOT 1
- Memory leak in function `responseInterceptor` of file `handlers/response-interceptor.ts` HOT 1
- Next.js App Router can't handle proxied requests HOT 16
- Filter example in README wrong. HOT 1
- Cannot override options in the `onProxyReq` method. HOT 1
- websocket messages interception & manipulation
- Intercept HTTP(s) calls and modify request "paths" on the fly HOT 1
- Issue obtaining body and updating it as part of proxy HOT 3
- Proxy request fails due to bodyParser HOT 1
- Fails to proxy from localhost to localhost HOT 2
- Too many subscriptions to Server.close event cause a OOM? HOT 4
- TS type compatibility HOT 4
- ERR_HTTP_HEADERS_SENT from onProxyReq with https-proxy-agent HOT 2
- Proxy to another proxy HOT 1
- Security Vulnerability in Dependency | follow-redirects HOT 2
- "Invalid context" error message is unhelpful when mixing paths with globs HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from http-proxy-middleware.