Git Product home page Git Product logo

Comments (3)

antoniomika avatar antoniomika commented on June 2, 2024

Just by design of sish, the server hosts both subdomains and ports. As long as the host name resolves to the same server, you can achieve what you want by doing a tcp forward for the 3001 port. Something like:

ssh -R dev:80:localhost:3000 -R 3001:localhost:3001 tuns.sh

Would likely work for you as long as the hot reload socket tries dev.tuns.sh:3001 as the websocket.

If that doesn't work and you're able to change the address the browser uses for the websocket, you can forward the socket at a path and that would work as well. Just note that path wouldn't be accessible by the main app.

from sish.

VitalyVaryvdin avatar VitalyVaryvdin commented on June 2, 2024

Indeed. Didn't actually think about wildcard pointing to the same host. Thanks for the clarification.

Though, this command has been giving me connection refused error, after updating my local Vite it is now possible to use HMR on the same port with dev server, however it kept reloading the page until I specified --idle-connection=false in the CLI.

How would multi-tenancy be handled in that case?
For example, there are demo-page-1.tuns.sh and demo-page-2.tuns.sh tunneled from different machines, but both use 3001 for websocket.

from sish.

antoniomika avatar antoniomika commented on June 2, 2024

In that situation, you'd have to provide different ports. sish only treats 3 types of forwards as unique:

  • http (80)
  • https (443)
  • SNI (443, or any other port you want)

sish doesn't have support for registering a multiplexing http server on every port, only on port 80 or 443. This has to do with tcp aliases as other port/hostname combos will turn into internal tunnels.

In your situation, you have a few options.

  1. Use different ports for the hot reloading middleware.
  2. Have sish forward a path to the port and configure the websocket url to use that path (example)
  3. Use SNI proxying and have the websocket hosted using TLS

I'll close this issue since it's use-case specific, but I'm happy to help here with anything.

from sish.

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.