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

client1.2.7,server1.1.11恢复正常连接速度方法 #101

Merged
merged 1 commit into from
Aug 8, 2024

Conversation

Sam5440
Copy link
Contributor

@Sam5440 Sam5440 commented Aug 5, 2024

No description provided.

@kingmo888
Copy link
Owner

不会吧,这样难道不会提示KEY不匹配么?

@Sam5440
Copy link
Contributor Author

Sam5440 commented Aug 7, 2024

不会吧,这样难道不会提示KEY不匹配么?

测试过,是可以的,相当于用自定义key代替自动生成的key了?(大概) 只要你客户端和服务端key对的上就没有问题,

@Sam5440
Copy link
Contributor Author

Sam5440 commented Aug 7, 2024

fn get_server_sk(key: &str) -> String {
    let mut key = key.to_owned();
    if let Ok(sk) = base64::decode(&key) {
        if sk.len() == sign::SECRETKEYBYTES {
            log::info!("The key is a crypto private key");
            key = base64::encode(&sk[(sign::SECRETKEYBYTES / 2)..]);
        }
    }

    if key == "-" || key == "_" {
        let (pk, _) = crate::common::gen_sk(300);
        key = pk;
    }

    if !key.is_empty() {
        log::info!("Key: {}", key);
    }

    key
}

逻辑应该是如果你有key就用你的key没有的话就自动生成一个公私钥加密?如果公私钥就慢了(貌似)

@kingmo888
Copy link
Owner

感谢。经过测试,compose方式或window服务端形式只要自设确实可以。

不过具体用法上需要更加详细的描述或图例说明,这样的话就需要额外增加readme内容,请问你在合并pr或我更新图文描述并尾部添加致谢的两种方式之间,你倾向于哪种?

@Sam5440
Copy link
Contributor Author

Sam5440 commented Aug 8, 2024 via email

@kingmo888 kingmo888 merged commit 0748c8a into kingmo888:master Aug 8, 2024
@Sam5440 Sam5440 deleted the patch-1 branch August 10, 2024 04:15
@Sam5440 Sam5440 restored the patch-1 branch August 10, 2024 04:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants