Skip to content
New issue

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

Enable WSS (Secure Websocket) usage #3

Open
passchn opened this issue Sep 14, 2022 · 1 comment
Open

Enable WSS (Secure Websocket) usage #3

passchn opened this issue Sep 14, 2022 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@passchn
Copy link
Collaborator

passchn commented Sep 14, 2022

Development under Safari is currently not possible, a [Warning] [blocked] The page at https://my-domain.local was not allowed to run insecure content from http://localhost:3000/webroot_src/main.ts. etc. warning will be logged.

When switching the vite config to wss like so:

    server: {
        hmr: {
            protocol: 'wss',
            host: 'localhost',
            port: 3000,
        },
    },

... and changing http://localhost: to https://localhost: in the ViteScriptsHelper, it still won't work due to SSL errors/certificate mismatches.

@passchn passchn added the enhancement New feature or request label Sep 14, 2022
@passchn passchn added the help wanted Extra attention is needed label Jan 22, 2023
@bor-attila
Copy link
Contributor

I don't use safari, but @vitejs/plugin-basic-ssl not helping ?

Here is my vite.config.js what I use. I use SSL even in development.

import {defineConfig} from 'vite'
import vue from '@vitejs/plugin-vue'
import legacy from '@vitejs/plugin-legacy';
import basicSsl from '@vitejs/plugin-basic-ssl'

// https://vitejs.dev/config/
export default defineConfig({
    plugins: [
        basicSsl(),
        vue(),
        legacy({
            targets: ['defaults', 'not IE 11']
        })
    ],
    resolve: {
        alias: {
            vue: 'vue/dist/vue.esm-bundler.js',
        },
    },
    server: {
        https: true,
        host: '0.0.0.0',
        port: 3000,
        strictPort: true,
        hmr: {
            protocol: 'wss',
        },
        watch: {
            ignored: [/bin/, /config/, /plugins/, /resources/, /tests/, /vendor/, /logs/, /tmp/],
            depth: 5,
        }
    },
    build: {
        emptyOutDir: true,
        outDir: './webroot/build',
        assetsDir: 'css',
        manifest: true,
        rollupOptions: {
            input: [
                './webroot_src/js/main.js',
            ],
            output: {
                entryFileNames: '[name].[hash].min.js',
            }
        }
    },
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Development

No branches or pull requests

2 participants