Skip to content

Need to connect from another machine #637

Description

@AcnodeLabs

it works on local machine but not connectable from another machine

e.g from PC on same network
trying

http://192.168.100.255:49787

Activity

  1. kenzieschmoll commented on May 2, 2019

    @kenzieschmoll
    Member

    Do you have a running flutter app connected to both machines? If you have two different runs (one on each machine), the URI will also be different.

    How are you running your Flutter app (i.e. InteilliJ, VS Code, command line)?

  2. devoncarew commented on May 2, 2019

    @devoncarew
    Contributor

    My suspicion is that you'd have to set up ssh tunneling for this use case.

  3. AcnodeLabs commented on May 2, 2019

    @AcnodeLabs
    Author
  4. jacob314 commented on May 3, 2019

    @jacob314
    Contributor

    The Dart VM Service currently only accepts connections that are coming from "localhost". Now that we have added a security token to the URLS the VM service accepts we may be able to relax this restriction. Stay tuned!

  5. AcnodeLabs commented on May 3, 2019

    @AcnodeLabs
    Author
  6. added this to the Backlog milestone on Jun 17, 2019
  7. mockturtl commented on Dec 12, 2019

    @mockturtl

    Now that we have added a security token to the URLS the VM service accepts we may be able to relax this restriction. Stay tuned!

    Is it possible to use devtools on chromeOS otherwise? ref

  8. SebTardif commented on Apr 17, 2020

    @SebTardif

    Looks like my use case match this issue. I use flutter web, and the flutter web access a third party server that doesn't support cors. So my flutter web app cannot just run standalone it need some self server support to workaround cors. So I created my own node.js server that proxy to that third party. Now, in development, I start my web flutter from visual studio code and give it a fix port like 8080, and instead of pointing directly to this, I point to my node.js server that will forward the third party api and also the index.html to that live flutter app hosted on port 8080, so that I can pick-up fast changes to the flutter app. I run node.js server in docker, and so it's a different network, and so I end-up not able to connect from docker container to host ip (which is not localhost), at least on Mac.

  9. kenzieschmoll commented on Oct 17, 2024

    @kenzieschmoll
    Member

    @DanTup does the recent work you've done to support remote workflows address this issue?

  10. added
    P3issues we think are valid but not important
    on Oct 17, 2024
  11. DanTup commented on Oct 18, 2024

    @DanTup
    Contributor

    I'm not sure I understand whether the request here is "be able to access DevTools that is hosted on another machine" or "connect a local DevTools to a VM service on another machine".

    I think the first may by possible by using something like dart devtools --host=0.0.0.0 which instructs the DevTools server to bind to all IP addresses instead of only localhost, however for the latter I'm not sure is possible to Flutter (I don't see any flags on flutter run to control which IP the forwarding applies for).. For Dart it can be done with dart run --observe which also takes an IP/hostname.

    The work I did recently was a little different, it was to support when there are two different IP addresses/hostnames for a service (eg. in a cloud IDE or VS Code remoting session, where localhost or a private IP address is not accessible to the end user, but there is an API provided by the IDE that can create a tunnel).

  12. Krysl commented on Feb 22, 2025

    @Krysl

    Just had the same problem, and figured out a solution:

    You only need a reverse proxy
    Localhost to local network port redirection on Windows

  13. crazidev commented on Apr 19, 2026

    @crazidev

    I'm not sure I understand whether the request here is "be able to access DevTools that is hosted on another machine" or "connect a local DevTools to a VM service on another machine".

    I think the first may by possible by using something like dart devtools --host=0.0.0.0 which instructs the DevTools server to bind to all IP addresses instead of only localhost, however for the latter I'm not sure is possible to Flutter (I don't see any flags on flutter run to control which IP the forwarding applies for).. For Dart it can be done with dart run --observe which also takes an IP/hostname.

    The work I did recently was a little different, it was to support when there are two different IP addresses/hostnames for a service (eg. in a cloud IDE or VS Code remoting session, where localhost or a private IP address is not accessible to the end user, but there is an API provided by the IDE that can create a tunnel).

    Back to this issue. Can you help provide a guide to adding support to bind the vm_service to 0.0.0.0? I don't mind rebuilding from source.

    I'm trying to create expo go similar solution for flutter which doesn't depend on Xcode for proxying.

  14. DanTup commented on Apr 20, 2026

    @DanTup
    Contributor

    @crazidev

    Back to this issue. Can you help provide a guide to adding support to bind the vm_service to 0.0.0.0? I don't mind rebuilding from source.

    Without better understanding your setup and what you're trying to do, I don't whether this is the best way to achieve it, but I think you'd need to control where DDS is listening (DDS proxies the VM Service traffic to add additional functionality), and I think the binding for that is here:

    https://github.com/flutter/flutter/blob/2844af6a713467da39a34658fb889a61a953cb67/packages/flutter_tools/lib/src/base/dds.dart#L81-L82

    It's hard-coded to use the loopback address so I don't think you can change it with flags, you'd have to modify the source and rebuild the tool. If you do this, be aware of the implications of exposing the VM Service to your network (the VM service supports evaluating arbitrary Dart code by anyone that can connect to it, although the auth codes should provide some protection).

    Tunnelling the port (for example over SSH) would be more secure (and is what VS Code does if you connect to a remote machine).

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3issues we think are valid but not important

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions