Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> socket.io połączenie z domeną https
dvdx95
post
Post #1





Grupa: Zarejestrowani
Postów: 47
Pomógł: 3
Dołączył: 11.10.2016

Ostrzeżenie: (0%)
-----


Cześć, nie mogę poradzić sobie jak rozwiązać ten problem

Mianowicie serwer.js jest postawiny na http, domena ma certyfikat https:

wie ktoś jak nawiązać po stronie domeny albo jak skonfigurować połączenie aby nie wywalało błędu "mixed content was loaded over https but requested an insecure xmlhttprequest endpoint"

server.js
  1. var app = require('express')();
  2. var http = require('http').Server(app);
  3. var io = require('socket.io')(http);
  4. var port = process.env.PORT || 3000;
  5. var users = 0;
  6.  
  7. app.get('/', function(req, res){
  8. res.sendFile(__dirname + '/www/socket.io/index.html');
  9. });
  10.  
  11. io.on('connection', function(socket){
  12. console.log('a user connected');
  13. socket.on('disconnect', function(){
  14. console.log('user disconnected');
  15. });
  16. });


po stronie index.html

  1. var socket = io('http://localhost:3000/',);


W jaki sposób zrobić tutaj połączenie najlepiej na https://domena.com:3000 ?

Może ktoś nakieruje

jakoś udało mi się to ogarnąć, połączenie mam z tym że serwer nie ma komercyjnego certyfikatu ssl i z tym trochę lipa biggrin.gif

Ten post edytował dvdx95 18.01.2018, 23:50:45
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 22.08.2025 - 06:39