Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: better localhost development #10020

Open
joebnb opened this issue Jun 8, 2024 · 0 comments
Open

feat: better localhost development #10020

joebnb opened this issue Jun 8, 2024 · 0 comments

Comments

@joebnb
Copy link

joebnb commented Jun 8, 2024

Describe the problem

recently i found tauri, and try to migrate my project to tauri and found a convenient features that tauri is not have,that propagation request to it's host when using native request.

eg:

// in native ios emulator:
fetch('localhost:1420/api/endpoint')
// it will forward this request to laptop's localhost:1420/api
// and in vite config.ts or some other proxy tools already define proxy like
server: {
      proxy: {
          '/api': {
              target: 'http://127.0.0.1:3000',
              changeOrigin: true,
              rewrite: (path) => path.replace(/^\/api/, ''),
          },
      },
  },

would consider add it into tauri,otherwise, when i start dev the project if my laptop ip change,i need change ip each time.

if support visit emulator localhost it will propagation to it's host,i may use localhost when dev, and use some hostname in production.

Describe the solution you'd like

ionic-team/capacitor#6388 like this issue have some valuable info,that user can visit emulator localhost to visit it's host

image

capacitor http request request localhost and it's have response

Alternatives considered

No response

Additional context

No response

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

No branches or pull requests

1 participant