@@ -475,6 +475,30 @@ describe('Proxy text producers', function () {
475475 ) ;
476476 } ) ;
477477
478+ it ( 'produces URI VLESS websocket links with pcs from tls fingerprint' , function ( ) {
479+ const output = produceExternal ( 'URI' , {
480+ type : 'vless' ,
481+ name : 'URI WS PCS' ,
482+ server : 'vless.example.com' ,
483+ port : 443 ,
484+ uuid : UUID ,
485+ tls : true ,
486+ sni : 'sni.example.com' ,
487+ 'tls-fingerprint' : 'fingerprint' ,
488+ network : 'ws' ,
489+ 'ws-opts' : {
490+ path : '/ws' ,
491+ headers : {
492+ Host : 'cdn.example.com' ,
493+ } ,
494+ } ,
495+ } ) ;
496+
497+ expect ( output ) . to . equal (
498+ `vless://${ UUID } @vless.example.com:443?security=tls&type=ws&path=%2Fws&host=cdn.example.com&pcs=fingerprint&sni=sni.example.com#URI%20WS%20PCS` ,
499+ ) ;
500+ } ) ;
501+
478502 it ( 'produces URI VLESS fake-http links with method and headerType' , function ( ) {
479503 const output = produceExternal ( 'URI' , {
480504 type : 'vless' ,
@@ -687,6 +711,30 @@ describe('Proxy text producers', function () {
687711 ) ;
688712 } ) ;
689713
714+ it ( 'produces URI Trojan websocket links with pcs from tls fingerprint' , function ( ) {
715+ const output = produceExternal ( 'URI' , {
716+ type : 'trojan' ,
717+ name : 'URI Trojan PCS' ,
718+ server : 'trojan.example.com' ,
719+ port : 443 ,
720+ password : 'secret' ,
721+ tls : true ,
722+ sni : 'sni.example.com' ,
723+ 'tls-fingerprint' : 'fingerprint' ,
724+ network : 'ws' ,
725+ 'ws-opts' : {
726+ path : '/ws' ,
727+ headers : {
728+ Host : 'cdn.example.com' ,
729+ } ,
730+ } ,
731+ } ) ;
732+
733+ expect ( output ) . to . equal (
734+ 'trojan://secret@trojan.example.com:443?sni=sni.example.com&type=ws&path=%2Fws&host=cdn.example.com&pcs=fingerprint#URI%20Trojan%20PCS' ,
735+ ) ;
736+ } ) ;
737+
690738 it ( 'produces V2Ray exports as base64 encoded URI lists' , function ( ) {
691739 const output = produceExternal ( 'V2Ray' , {
692740 type : 'vless' ,
0 commit comments