You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there a way to configure the IP address on which the server is bound ,
as I see 127.0.0.1 is hardcoded , it should be flexible so user could
change IP and port of the server
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!
On Fri, May 3, 2019, 07:05 Jacob Richman ***@***.***> wrote:
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!
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#637 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABAFIZ5ALGTLB4SQBNZ7GYTPTOMXLANCNFSM4HJ3MTIA>
.
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.
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).
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.
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:
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).
Activity
kenzieschmoll commentedon May 2, 2019
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)?
devoncarew commentedon May 2, 2019
My suspicion is that you'd have to set up ssh tunneling for this use case.
AcnodeLabs commentedon May 2, 2019
jacob314 commentedon May 3, 2019
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!
AcnodeLabs commentedon May 3, 2019
mockturtl commentedon Dec 12, 2019
Is it possible to use devtools on chromeOS otherwise? ref
SebTardif commentedon Apr 17, 2020
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.
kenzieschmoll commentedon Oct 17, 2024
@DanTup does the recent work you've done to support remote workflows address this issue?
DanTup commentedon Oct 18, 2024
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.0which instructs the DevTools server to bind to all IP addresses instead of onlylocalhost, however for the latter I'm not sure is possible to Flutter (I don't see any flags onflutter runto control which IP the forwarding applies for).. For Dart it can be done withdart run --observewhich 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).
Krysl commentedon Feb 22, 2025
Just had the same problem, and figured out a solution:
crazidev commentedon Apr 19, 2026
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.
DanTup commentedon Apr 20, 2026
@crazidev
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).