Support secure websocket connections#1537
Conversation
|
@kmjennison Great contribution, thanks 🙌 Pushed the changes under Just an FYI, I made a subsequent PR (#1539) to clean up some stuff:
Really appreciate taking the time to make the changes and test everything! |
|
Wonderful, thanks for the follow-up! Glad I could help. |
|
@skidding Are you sure this made it into the latest release? I installed v6.0.0-beta.6 and still see the insecure websocket. In addition, import { createPostMessageConnect, createWebSocketsConnect, } from 'react-cosmos-core';
import { isInsideCosmosPreviewIframe } from './utils/isInsideCosmosPreviewIframe.js';
export function createDomRendererConnect(playgroundUrl) {
return isInsideCosmosPreviewIframe()
? createPostMessageConnect()
: createWebSocketsConnect(getWebSocketsUrl(playgroundUrl));
}
function getWebSocketsUrl(playgroundUrl) {
return playgroundUrl.replace(/^https?:/, 'ws:');
} |
|
@kmjennison I think so. Make sure to install all Cosmos packages you use with Also, you can browse the published code here: https://www.npmjs.com/package/react-cosmos-dom/v/6.0.0-beta.6?activeTab=code – the file you mentioned doesn't exist in this version. |
|
@kmjennison Let me know if upgrading all packages worked, otherwise I'd like to help find the issue. |
|
@skidding This is working and all good! My yarn.lock was resolving to an older canary release. Thanks! |
Closes #1525.