title: Set up onion server with Dart (Flutter) on Smartphones
body: <p>I am looking for a way to set up a hidden service v3 on a smartphone with Flutter. I have already looked at the project <a href="https://github.com/utopicnarwhal/utopic_tor_onion_proxy" rel="nofollow noreferrer">utopic_tor_onion_proxy</a> on github, but I want to use the torproject binaries directly and it is also not possible to handle requests.
  For some tips on how to do this with for example a Flutter plugin I would be very grateful.
  Also I would be glad about a small code example.</p>
  <p>I was already able to create a server and reach it with the following code:</p>
  <pre><code>class MyServer {  
  
  void main(List&lt;String&gt; args) async {
  // Use any available host or container IP (usually `0.0.0.0`).
  final ip = InternetAddress.anyIPv4;
  
  // Configure a pipeline that logs requests.
  final _handler = Pipeline().addMiddleware(logRequests()).addHandler(_router);
  
  // For running in containers, we respect the PORT environment variable.
  final port = int.parse(Platform.environment['PORT'] ?? '5555');
  final server = await serve(_handler, ip, port);
  print('Server listening on port ${server.port}');
  
  
   }}
  </code></pre>