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 utopic_tor_onion_proxy 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.
I was already able to create a server and reach it with the following code:
class MyServer {
void main(List<String> 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}');
}}