Skip to main content

interceptly_socket_io 1.0.1 copy "interceptly_socket_io: ^1.0.1" to clipboard
interceptly_socket_io: ^1.0.1 copied to clipboard

Socket.IO adapter for Interceptly network inspector.

example/main.dart

// ignore_for_file: avoid_print
import 'package:interceptly_socket_io/interceptly_socket_io.dart';
import 'package:socket_io_client/socket_io_client.dart' as io;

Future<void> main() async {
  // 1. Create a Socket.IO client instance
  final socket = io.io(
    'https://echo.websocket.events',
    io.OptionBuilder()
        .setTransports(['websocket'])
        .disableAutoConnect()
        .build(),
  );

  // 2. Attach Interceptly inspector (or use InterceptlySocketIo.attach(socket))
  final tracker = socket.attachInterceptly();

  // 3. Listen to incoming events
  socket.on('chat_message', (data) {
    print('Received chat_message: $data');
  });

  // 4. Connect and emit events
  socket.connect();
  socket.emit('chat_message', {'text': 'Hello Interceptly Socket.IO!'});

  await Future<void>.delayed(const Duration(seconds: 2));

  // 5. Clean detach and close
  tracker.detach();
  socket.disconnect();
}
0
likes
160
points
0
downloads

Documentation

API reference

Publisher

verified publisherstormx.dev

Weekly Downloads

Socket.IO adapter for Interceptly network inspector.

Repository (GitHub)
View/report issues
Contributing

License

MIT (license)

Dependencies

flutter, interceptly, socket_io_client

More

Packages that depend on interceptly_socket_io