We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I cant not connect to my NodeJs localhost with "https://localhost:port This my client code
`import 'package:flutter/material.dart'; import 'const.dart'; import 'package:socket_io_client/socket_io_client.dart' as IO; void main() => runApp(MyApp()); class MyApp extends StatelessWidget { @OverRide Widget build(BuildContext context) { IO.Socket socket = IO.io('https://localhost:80', <String, dynamic>{ 'transports': ['websocket'], 'autoConnect': false, 'secure':true, 'agent':true, 'rejectUnauthorized': false, 'extraHeaders': {'rejectUnauthorized': false} }); socket.connect(); print(socket.connected); socket.on('SERVER_PING', (data)=>print(data)); return MaterialApp( title: 'Chat Demo', theme: ThemeData( primaryColor: themeColor, ), home: RaisedButton(child: Text("Hello"),onPressed: () socket.emit("/test","hello"); //socket.on("/tests",(data)=>print(data)); },), debugShowCheckedModeBanner: false, ); } }
`import 'package:flutter/material.dart';
import 'const.dart'; import 'package:socket_io_client/socket_io_client.dart' as IO; void main() => runApp(MyApp());
class MyApp extends StatelessWidget { @OverRide Widget build(BuildContext context) { IO.Socket socket = IO.io('https://localhost:80', <String, dynamic>{ 'transports': ['websocket'], 'autoConnect': false, 'secure':true, 'agent':true, 'rejectUnauthorized': false, 'extraHeaders': {'rejectUnauthorized': false} }); socket.connect(); print(socket.connected); socket.on('SERVER_PING', (data)=>print(data)); return MaterialApp( title: 'Chat Demo', theme: ThemeData( primaryColor: themeColor, ), home: RaisedButton(child: Text("Hello"),onPressed: () socket.emit("/test","hello"); //socket.on("/tests",(data)=>print(data)); },), debugShowCheckedModeBanner: false, ); } }
and my servver code:
var express = require('express'); const https = require('https'); //const http=require('http') var app = express(); const fs = require('fs') //const server=http.createServer(app) const server = https.createServer({ key: fs.readFileSync('./ssl_cert/key.key'), cert: fs.readFileSync('./ssl_cert/cert.cert'), ca: fs.readFileSync('./ssl_cert/ca.crt') }, app) var io = require('socket.io')(server); io.on('connection', function (socket) { console.log(socket.id, 'joined'); socket.emit("SERVER_PING","Test") socket.on('/test', function (msg) { socket.emit("SERVER_PING","Test")// socket.emit("/tests","Hello"); console.log(msg); }); }); var port = 80; console.log(port); server.listen(port);`
var express = require('express'); const https = require('https'); //const http=require('http') var app = express(); const fs = require('fs') //const server=http.createServer(app) const server = https.createServer({ key: fs.readFileSync('./ssl_cert/key.key'), cert: fs.readFileSync('./ssl_cert/cert.cert'), ca: fs.readFileSync('./ssl_cert/ca.crt') }, app) var io = require('socket.io')(server);
io.on('connection', function (socket) { console.log(socket.id, 'joined'); socket.emit("SERVER_PING","Test") socket.on('/test', function (msg) { socket.emit("SERVER_PING","Test")// socket.emit("/tests","Hello"); console.log(msg); }); });
var port = 80; console.log(port); server.listen(port);`
Tks Trung
The text was updated successfully, but these errors were encountered:
i have the same problem
Sorry, something went wrong.
FYI: #84
add Troubleshooting section for #84 and #95
36e7d5d
This working?
No branches or pull requests
I cant not connect to my NodeJs localhost with "https://localhost:port
This my client code
and my servver code:
Tks
Trung
The text was updated successfully, but these errors were encountered: