Coder Social home page Coder Social logo

Comments (8)

chimurai avatar chimurai commented on May 17, 2024

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.

huigesv123 avatar huigesv123 commented on May 17, 2024

@chimurai

I added agent: "https.globalAgent",But still not work

from http-proxy-middleware.

chimurai avatar chimurai commented on May 17, 2024

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.

huigesv123 avatar huigesv123 commented on May 17, 2024

@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.

chimurai avatar chimurai commented on May 17, 2024

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.

huigesv123 avatar huigesv123 commented on May 17, 2024

@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.

chimurai avatar chimurai commented on May 17, 2024

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'); versus var 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 a https: 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.

chimurai avatar chimurai commented on May 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.