1
0
mirror of https://github.com/amitbet/vncproxy.git synced 2025-05-05 22:26:24 +00:00

added cmdline binaries for proxy and player

This commit is contained in:
amit bezalel 2017-07-28 17:48:22 +03:00
parent 28c664f5cd
commit eed10643b3
8 changed files with 463 additions and 295 deletions

View File

@ -24,6 +24,7 @@
<option name="SHOW_EMPTY_GROUPS" value="false" />
<option name="AUTO_SCROLL_FROM_SOURCE" value="false" />
</component>
<component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
<component name="FavoritesManager">
<favorites_list name="vncproxy" />
</component>
@ -32,7 +33,7 @@
<file leaf-file-name="ws-server-go.go" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/server/ws-server-go.go">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="120">
<state relative-caret-position="144">
<caret line="15" column="10" lean-forward="false" selection-start-line="15" selection-start-column="10" selection-end-line="15" selection-end-column="10" />
<folding />
</state>
@ -42,7 +43,7 @@
<file leaf-file-name="server-conn.go" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/server/server-conn.go">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="3105">
<state relative-caret-position="3726">
<caret line="214" column="5" lean-forward="false" selection-start-line="214" selection-start-column="5" selection-end-line="214" selection-end-column="5" />
<folding />
</state>
@ -52,7 +53,7 @@
<file leaf-file-name="server-message-type.go" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/common/server-message-type.go">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="45">
<state relative-caret-position="54">
<caret line="5" column="0" lean-forward="false" selection-start-line="5" selection-start-column="0" selection-end-line="5" selection-end-column="0" />
<folding />
</state>
@ -62,7 +63,7 @@
<file leaf-file-name="pointer.go" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/client/pointer.go">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="105">
<state relative-caret-position="126">
<caret line="7" column="15" lean-forward="false" selection-start-line="7" selection-start-column="15" selection-end-line="7" selection-end-column="15" />
<folding />
</state>
@ -72,7 +73,7 @@
<file leaf-file-name="server_test.go" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/server/server_test.go">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="465">
<state relative-caret-position="558">
<caret line="36" column="27" lean-forward="false" selection-start-line="36" selection-start-column="27" selection-end-line="36" selection-end-column="27" />
<folding />
</state>
@ -92,7 +93,7 @@
<file leaf-file-name="server.go" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/server/server.go">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="270">
<state relative-caret-position="324">
<caret line="24" column="1" lean-forward="false" selection-start-line="24" selection-start-column="1" selection-end-line="24" selection-end-column="1" />
<folding />
</state>
@ -102,7 +103,7 @@
<file leaf-file-name="security.go" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/server/security.go">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1125">
<state relative-caret-position="1350">
<caret line="82" column="0" lean-forward="false" selection-start-line="82" selection-start-column="0" selection-end-line="82" selection-end-column="0" />
<folding>
<element signature="e#16#100#0" expanded="true" />
@ -114,8 +115,8 @@
<file leaf-file-name="handlers.go" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/server/handlers.go">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1125">
<caret line="82" column="18" lean-forward="true" selection-start-line="82" selection-start-column="18" selection-end-line="82" selection-end-column="18" />
<state relative-caret-position="242">
<caret line="71" column="18" lean-forward="false" selection-start-line="71" selection-start-column="18" selection-end-line="71" selection-end-column="18" />
<folding />
</state>
</provider>
@ -224,11 +225,11 @@
<component name="MavenProjectNavigator">
<treeState />
</component>
<component name="ProjectFrameBounds" extendedState="6">
<option name="x" value="140" />
<option name="y" value="154" />
<option name="width" value="1680" />
<option name="height" value="1023" />
<component name="ProjectFrameBounds">
<option name="x" value="180" />
<option name="y" value="116" />
<option name="width" value="1280" />
<option name="height" value="800" />
</component>
<component name="ProjectInspectionProfilesVisibleTreeState">
<entry key="Project Default">
@ -283,24 +284,9 @@
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="ProjectPane">
<subPane>
<expand>
<path>
<item name="vncproxy" type="b2602c69:ProjectViewProjectNode" />
<item name="vncproxy" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="vncproxy" type="b2602c69:ProjectViewProjectNode" />
<item name="vncproxy" type="462c0819:PsiDirectoryNode" />
<item name="server" type="462c0819:PsiDirectoryNode" />
</path>
</expand>
<select />
</subPane>
</pane>
<pane id="Scope" />
<pane id="Scratches" />
<pane id="Scope" />
<pane id="ProjectPane" />
<pane id="PackagesPane" />
<pane id="AndroidView" />
</panes>
@ -325,176 +311,13 @@
</list>
</option>
</component>
<component name="RunManager">
<configuration name="Server" type="GoApplicationRunConfiguration" factoryName="Go Application">
<module name="vncproxy" />
<working_directory value="$PROJECT_DIR$" />
<go_parameters value="-i" />
<filePath value="C:\Users\betzalel\Dropbox\go\src\vncproxy\server\main.go" />
<kind value="FILE" />
<package value="vncproxy" />
</configuration>
<configuration default="true" type="Applet" factoryName="Applet">
<option name="HTML_USED" value="false" />
<option name="WIDTH" value="400" />
<option name="HEIGHT" value="300" />
<option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
<module />
</configuration>
<configuration default="true" type="Application" factoryName="Application">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<option name="MAIN_CLASS_NAME" />
<option name="VM_PARAMETERS" />
<option name="PROGRAM_PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<module name="" />
<envs />
</configuration>
<configuration default="true" type="FlashRunConfigurationType" factoryName="Flash App">
<option name="BCName" value="" />
<option name="IOSSimulatorSdkPath" value="" />
<option name="adlOptions" value="" />
<option name="airProgramParameters" value="" />
<option name="appDescriptorForEmulator" value="Android" />
<option name="debugTransport" value="USB" />
<option name="debuggerSdkRaw" value="BC SDK" />
<option name="emulator" value="NexusOne" />
<option name="emulatorAdlOptions" value="" />
<option name="fastPackaging" value="true" />
<option name="fullScreenHeight" value="0" />
<option name="fullScreenWidth" value="0" />
<option name="launchUrl" value="false" />
<option name="launcherParameters">
<LauncherParameters>
<option name="browser" value="a7bb68e0-33c0-4d6f-a81a-aac1fdb870c8" />
<option name="launcherType" value="OSDefault" />
<option name="newPlayerInstance" value="false" />
<option name="playerPath" value="FlashPlayerDebugger.exe" />
</LauncherParameters>
</option>
<option name="mobileRunTarget" value="Emulator" />
<option name="moduleName" value="" />
<option name="overriddenMainClass" value="" />
<option name="overriddenOutputFileName" value="" />
<option name="overrideMainClass" value="false" />
<option name="runTrusted" value="true" />
<option name="screenDpi" value="0" />
<option name="screenHeight" value="0" />
<option name="screenWidth" value="0" />
<option name="url" value="http://" />
<option name="usbDebugPort" value="7936" />
</configuration>
<configuration default="true" type="FlexUnitRunConfigurationType" factoryName="FlexUnit" appDescriptorForEmulator="Android" class_name="" emulatorAdlOptions="" method_name="" package_name="" scope="Class">
<option name="BCName" value="" />
<option name="launcherParameters">
<LauncherParameters>
<option name="browser" value="a7bb68e0-33c0-4d6f-a81a-aac1fdb870c8" />
<option name="launcherType" value="OSDefault" />
<option name="newPlayerInstance" value="false" />
<option name="playerPath" value="FlashPlayerDebugger.exe" />
</LauncherParameters>
</option>
<option name="moduleName" value="" />
<option name="trusted" value="true" />
</configuration>
<configuration default="true" type="GoApplicationRunConfiguration" factoryName="Go Application">
<module name="vncproxy" />
<working_directory value="$PROJECT_DIR$" />
<go_parameters value="-i" />
<filePath value="C:\Users\betzalel\Dropbox\go\src\vncproxy" />
<kind value="FILE" />
<package value="vncproxy" />
</configuration>
<configuration default="true" type="GoTestRunConfiguration" factoryName="Go Test">
<module name="vncproxy" />
<working_directory value="$PROJECT_DIR$" />
<go_parameters value="-i" />
<framework value="gotest" />
<kind value="DIRECTORY" />
<package value="vncproxy" />
<directory value="$PROJECT_DIR$" />
<filePath value="$PROJECT_DIR$" />
</configuration>
<configuration default="true" type="GrailsRunConfigurationType" factoryName="Grails">
<setting name="vmparams" value="" />
<setting name="cmdLine" value="run-app" />
<setting name="passParentEnv" value="true" />
<setting name="launchBrowser" value="true" />
<setting name="launchBrowserUrl" value="" />
<setting name="depsClasspath" value="false" />
</configuration>
<configuration default="true" type="js.build_tools.gulp" factoryName="Gulp.js">
<node-interpreter>project</node-interpreter>
<node-options />
<gulpfile />
<tasks />
<arguments />
<envs />
</configuration>
<configuration default="true" type="JUnit" factoryName="JUnit">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<module name="" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" />
<option name="MAIN_CLASS_NAME" />
<option name="METHOD_NAME" />
<option name="TEST_OBJECT" value="class" />
<option name="VM_PARAMETERS" value="-ea" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<envs />
<patterns />
</configuration>
<component name="RunManager" selected="Go Test.test proxy">
<configuration default="true" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin">
<module name="" />
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" />
<option name="PROGRAM_PARAMETERS" />
<predefined_log_file id="idea.log" enabled="true" />
</configuration>
<configuration default="true" type="Remote" factoryName="Remote">
<option name="USE_SOCKET_TRANSPORT" value="true" />
<option name="SERVER_MODE" value="false" />
<option name="SHMEM_ADDRESS" value="javadebug" />
<option name="HOST" value="localhost" />
<option name="PORT" value="5005" />
</configuration>
<configuration default="true" type="TestNG" factoryName="TestNG">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<module name="" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="SUITE_NAME" />
<option name="PACKAGE_NAME" />
<option name="MAIN_CLASS_NAME" />
<option name="METHOD_NAME" />
<option name="GROUP_NAME" />
<option name="TEST_OBJECT" value="CLASS" />
<option name="VM_PARAMETERS" value="-ea" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
<option name="OUTPUT_DIRECTORY" />
<option name="ANNOTATION_TYPE" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<option name="USE_DEFAULT_REPORTERS" value="false" />
<option name="PROPERTIES_FILE" />
<envs />
<properties />
<listeners />
<method />
</configuration>
<configuration default="true" type="AndroidRunConfigurationType" factoryName="Android App">
<module name="" />
@ -551,6 +374,29 @@
</Profilers>
<method />
</configuration>
<configuration default="true" type="Applet" factoryName="Applet">
<option name="HTML_USED" value="false" />
<option name="WIDTH" value="400" />
<option name="HEIGHT" value="300" />
<option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
<module />
<method />
</configuration>
<configuration default="true" type="Application" factoryName="Application">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<option name="MAIN_CLASS_NAME" />
<option name="VM_PARAMETERS" />
<option name="PROGRAM_PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="ENABLE_SWING_INSPECTOR" value="false" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<module name="" />
<envs />
<method />
</configuration>
<configuration default="true" type="ArquillianJUnit" factoryName="" nameIsGenerated="true">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<module name="" />
@ -632,11 +478,69 @@
<envs />
<method />
</configuration>
<configuration default="true" type="FlashRunConfigurationType" factoryName="Flash App">
<option name="BCName" value="" />
<option name="IOSSimulatorSdkPath" value="" />
<option name="adlOptions" value="" />
<option name="airProgramParameters" value="" />
<option name="appDescriptorForEmulator" value="Android" />
<option name="debugTransport" value="USB" />
<option name="debuggerSdkRaw" value="BC SDK" />
<option name="emulator" value="NexusOne" />
<option name="emulatorAdlOptions" value="" />
<option name="fastPackaging" value="true" />
<option name="fullScreenHeight" value="0" />
<option name="fullScreenWidth" value="0" />
<option name="launchUrl" value="false" />
<option name="launcherParameters">
<LauncherParameters>
<option name="browser" value="a7bb68e0-33c0-4d6f-a81a-aac1fdb870c8" />
<option name="launcherType" value="OSDefault" />
<option name="newPlayerInstance" value="false" />
<option name="playerPath" value="FlashPlayerDebugger.exe" />
</LauncherParameters>
</option>
<option name="mobileRunTarget" value="Emulator" />
<option name="moduleName" value="" />
<option name="overriddenMainClass" value="" />
<option name="overriddenOutputFileName" value="" />
<option name="overrideMainClass" value="false" />
<option name="runTrusted" value="true" />
<option name="screenDpi" value="0" />
<option name="screenHeight" value="0" />
<option name="screenWidth" value="0" />
<option name="url" value="http://" />
<option name="usbDebugPort" value="7936" />
<method />
</configuration>
<configuration default="true" type="FlexUnitRunConfigurationType" factoryName="FlexUnit" appDescriptorForEmulator="Android" class_name="" emulatorAdlOptions="" method_name="" package_name="" scope="Class">
<option name="BCName" value="" />
<option name="launcherParameters">
<LauncherParameters>
<option name="browser" value="a7bb68e0-33c0-4d6f-a81a-aac1fdb870c8" />
<option name="launcherType" value="OSDefault" />
<option name="newPlayerInstance" value="false" />
<option name="playerPath" value="FlashPlayerDebugger.exe" />
</LauncherParameters>
</option>
<option name="moduleName" value="" />
<option name="trusted" value="true" />
<method />
</configuration>
<configuration default="true" type="GoAppEngineRunConfiguration" factoryName="Go App Engine">
<module name="vncproxy" />
<working_directory value="$PROJECT_DIR$" />
<method />
</configuration>
<configuration default="true" type="GoApplicationRunConfiguration" factoryName="Go Application">
<module name="vncproxy" />
<working_directory value="$PROJECT_DIR$" />
<go_parameters value="-i" />
<filePath value="C:\Users\betzalel\Dropbox\go\src\vncproxy" />
<kind value="FILE" />
<package value="vncproxy" />
<method />
</configuration>
<configuration default="true" type="GoRemoteDebugConfigurationType" factoryName="Go Remote">
<method />
</configuration>
@ -646,6 +550,17 @@
<filePath value="$PROJECT_DIR$" />
<method />
</configuration>
<configuration default="true" type="GoTestRunConfiguration" factoryName="Go Test">
<module name="vncproxy" />
<working_directory value="$PROJECT_DIR$" />
<go_parameters value="-i" />
<framework value="gotest" />
<kind value="DIRECTORY" />
<package value="vncproxy" />
<directory value="$PROJECT_DIR$" />
<filePath value="$PROJECT_DIR$" />
<method />
</configuration>
<configuration default="true" type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="executionName" />
@ -662,6 +577,36 @@
</ExternalSystemSettings>
<method />
</configuration>
<configuration default="true" type="GrailsRunConfigurationType" factoryName="Grails">
<setting name="vmparams" value="" />
<setting name="cmdLine" value="run-app" />
<setting name="passParentEnv" value="true" />
<setting name="launchBrowser" value="true" />
<setting name="launchBrowserUrl" value="" />
<setting name="depsClasspath" value="false" />
<method />
</configuration>
<configuration default="true" type="JUnit" factoryName="JUnit">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<module name="" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" />
<option name="MAIN_CLASS_NAME" />
<option name="METHOD_NAME" />
<option name="TEST_OBJECT" value="class" />
<option name="VM_PARAMETERS" value="-ea" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<envs />
<patterns />
<method />
</configuration>
<configuration default="true" type="JarApplication" factoryName="JAR Application">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<envs />
@ -724,12 +669,57 @@
<envs />
<method />
</configuration>
<configuration default="true" type="Remote" factoryName="Remote">
<option name="USE_SOCKET_TRANSPORT" value="true" />
<option name="SERVER_MODE" value="false" />
<option name="SHMEM_ADDRESS" value="javadebug" />
<option name="HOST" value="localhost" />
<option name="PORT" value="5005" />
<method />
</configuration>
<configuration default="true" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<module name="" />
<envs />
<method />
</configuration>
<configuration default="true" type="TestNG" factoryName="TestNG">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<module name="" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="SUITE_NAME" />
<option name="PACKAGE_NAME" />
<option name="MAIN_CLASS_NAME" />
<option name="METHOD_NAME" />
<option name="GROUP_NAME" />
<option name="TEST_OBJECT" value="CLASS" />
<option name="VM_PARAMETERS" value="-ea" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
<option name="OUTPUT_DIRECTORY" />
<option name="ANNOTATION_TYPE" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<option name="USE_DEFAULT_REPORTERS" value="false" />
<option name="PROPERTIES_FILE" />
<envs />
<properties />
<listeners />
<method />
</configuration>
<configuration default="true" type="js.build_tools.gulp" factoryName="Gulp.js">
<node-interpreter>project</node-interpreter>
<node-options />
<gulpfile />
<tasks />
<arguments />
<envs />
<method />
</configuration>
<configuration default="true" type="js.build_tools.npm" factoryName="npm">
<command value="run" />
<scripts />
@ -743,14 +733,24 @@
<configuration default="true" type="osgi.bnd.run" factoryName="Test Launcher (JUnit)">
<method />
</configuration>
<configuration name="main" type="GoApplicationRunConfiguration" factoryName="Go Application">
<configuration default="false" name="Server" type="GoApplicationRunConfiguration" factoryName="Go Application">
<module name="vncproxy" />
<working_directory value="$PROJECT_DIR$" />
<go_parameters value="-i" />
<filePath value="C:\Users\betzalel\Dropbox\go\src\vncproxy\server\main.go" />
<kind value="FILE" />
<package value="vncproxy" />
<method />
</configuration>
<configuration default="false" name="main" type="GoApplicationRunConfiguration" factoryName="Go Application">
<module name="vncproxy" />
<working_directory value="C:\Users\betzalel\Dropbox\go\src\vncproxy" />
<go_parameters value="-i" />
<filePath value="C:\Users\betzalel\Dropbox\go\src\vncproxy\main.go" />
<kind value="FILE" />
<method />
</configuration>
<configuration name="test player" type="GoTestRunConfiguration" factoryName="Go Test">
<configuration default="false" name="test player" type="GoTestRunConfiguration" factoryName="Go Test">
<module name="vncproxy" />
<working_directory value="$PROJECT_DIR$" />
<go_parameters value="-i" />
@ -759,8 +759,9 @@
<package value="vncproxy/player" />
<directory value="$PROJECT_DIR$" />
<filePath value="$PROJECT_DIR$/player" />
<method />
</configuration>
<configuration name="test proxy" type="GoTestRunConfiguration" factoryName="Go Test">
<configuration default="false" name="test proxy" type="GoTestRunConfiguration" factoryName="Go Test">
<module name="vncproxy" />
<working_directory value="$PROJECT_DIR$" />
<go_parameters value="-i" />
@ -769,8 +770,9 @@
<package value="vncproxy" />
<directory value="$PROJECT_DIR$/proxy/proxy_test.go" />
<filePath value="$PROJECT_DIR$/proxy/proxy_test.go" />
<method />
</configuration>
<configuration name="test server " type="GoTestRunConfiguration" factoryName="Go Test">
<configuration default="false" name="test server " type="GoTestRunConfiguration" factoryName="Go Test">
<module name="vncproxy" />
<working_directory value="$PROJECT_DIR$" />
<go_parameters value="-i" />
@ -779,6 +781,7 @@
<package value="vncproxy" />
<directory value="$PROJECT_DIR$/server/server_test.go" />
<filePath value="$PROJECT_DIR$/server/server_test.go" />
<method />
</configuration>
<list size="5">
<item index="0" class="java.lang.String" itemvalue="Go Application.Server" />
@ -817,6 +820,8 @@
<workItem from="1500413585910" duration="2404000" />
<workItem from="1500531144911" duration="595000" />
<workItem from="1500560041309" duration="115000" />
<workItem from="1500819528333" duration="190000" />
<workItem from="1501066263662" duration="147000" />
</task>
<servers />
</component>
@ -853,7 +858,7 @@
</history-entry>
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="68498000" />
<option name="totallyTimeSpent" value="68835000" />
</component>
<component name="TodoView">
<todo-panel id="selected-file">
@ -865,22 +870,24 @@
</todo-panel>
</component>
<component name="ToolWindowManager">
<frame x="0" y="23" width="1680" height="1023" extended-state="6" />
<frame x="180" y="116" width="1280" height="800" extended-state="0" />
<editor active="true" />
<layout>
<window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32876712" sideWeight="0.49030694" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Nl-Palette" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Palette&#9;" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Image Layers" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Capture Analysis" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.26293105" sideWeight="0.54846525" order="8" side_tool="true" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.41229385" sideWeight="0.54846525" order="8" side_tool="true" content_ui="tabs" />
<window_info id="Maven Projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32956383" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.22420909" sideWeight="0.49353796" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="true" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32876712" sideWeight="0.4676898" order="10" side_tool="false" content_ui="tabs" />
<window_info id="Properties" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32876712" sideWeight="0.49030694" order="11" side_tool="false" content_ui="tabs" />
<window_info id="Capture Tool" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Designer" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.32967034" sideWeight="0.6718266" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.5008197" sideWeight="0.6718266" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Problems" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="false" weight="0.21506849" sideWeight="0.49676898" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32956383" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3029079" sideWeight="0.48367348" order="6" side_tool="false" content_ui="tabs" />
@ -890,21 +897,39 @@
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.35068494" sideWeight="0.687399" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.2714055" sideWeight="0.32817337" order="5" side_tool="true" content_ui="tabs" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
<window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Nl-Palette" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.25588536" sideWeight="0.509299" order="8" side_tool="true" content_ui="tabs" />
<window_info id="Maven Projects" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32956383" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Properties" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Capture Tool" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
<window_info id="Designer" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32956383" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Dynamic Properties" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3029079" sideWeight="0.48367348" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.24959612" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="UI Designer" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.35068494" sideWeight="0.687399" order="4" side_tool="false" content_ui="tabs" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32876712" sideWeight="0.49030694" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="9" side_tool="false" content_ui="tabs" />
<window_info id="Palette&#9;" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Image Layers" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Capture Analysis" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Coverage" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="true" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25634825" sideWeight="0.490701" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="true" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32876712" sideWeight="0.4676898" order="10" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32876712" sideWeight="0.49030694" order="11" side_tool="false" content_ui="tabs" />
<window_info id="Project" active="true" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.3949939" sideWeight="0.6718266" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Problems" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="false" weight="0.21506849" sideWeight="0.49676898" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.26409903" sideWeight="0.45153475" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Theme Preview" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.2714055" sideWeight="0.32817337" order="5" side_tool="true" content_ui="tabs" />
</layout>
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="1" />
</component>
<component name="Vcs.Log.Tabs.Properties">
<option name="TAB_STATES">
<map>
@ -1169,18 +1194,10 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/common/server-message-type.go">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="45">
<caret line="5" column="0" lean-forward="false" selection-start-line="5" selection-start-column="0" selection-end-line="5" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/common/multiListener.go" />
<entry file="file://$PROJECT_DIR$/client/pointer.go">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="105">
<state relative-caret-position="126">
<caret line="7" column="15" lean-forward="false" selection-start-line="7" selection-start-column="15" selection-end-line="7" selection-end-column="15" />
<folding />
</state>
@ -1194,18 +1211,10 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/server/server.go">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="270">
<caret line="24" column="1" lean-forward="false" selection-start-line="24" selection-start-column="1" selection-end-line="24" selection-end-column="1" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/server/ws_test.go" />
<entry file="file://$PROJECT_DIR$/server/ws-server-go.go">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="120">
<state relative-caret-position="144">
<caret line="15" column="10" lean-forward="false" selection-start-line="15" selection-start-column="10" selection-end-line="15" selection-end-column="10" />
<folding />
</state>
@ -1213,7 +1222,7 @@
</entry>
<entry file="file://$PROJECT_DIR$/server/server-conn.go">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="3105">
<state relative-caret-position="3726">
<caret line="214" column="5" lean-forward="false" selection-start-line="214" selection-start-column="5" selection-end-line="214" selection-end-column="5" />
<folding />
</state>
@ -1221,7 +1230,7 @@
</entry>
<entry file="file://$PROJECT_DIR$/server/security.go">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1125">
<state relative-caret-position="1350">
<caret line="82" column="0" lean-forward="false" selection-start-line="82" selection-start-column="0" selection-end-line="82" selection-end-column="0" />
<folding>
<element signature="e#16#100#0" expanded="true" />
@ -1231,7 +1240,7 @@
</entry>
<entry file="file://$PROJECT_DIR$/server/server_test.go">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="465">
<state relative-caret-position="558">
<caret line="36" column="27" lean-forward="false" selection-start-line="36" selection-start-column="27" selection-end-line="36" selection-end-column="27" />
<folding />
</state>
@ -1239,8 +1248,24 @@
</entry>
<entry file="file://$PROJECT_DIR$/server/handlers.go">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1125">
<caret line="82" column="18" lean-forward="true" selection-start-line="82" selection-start-column="18" selection-end-line="82" selection-end-column="18" />
<state relative-caret-position="242">
<caret line="71" column="18" lean-forward="false" selection-start-line="71" selection-start-column="18" selection-end-line="71" selection-end-column="18" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/server/server.go">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="324">
<caret line="24" column="1" lean-forward="false" selection-start-line="24" selection-start-column="1" selection-end-line="24" selection-end-column="1" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/common/server-message-type.go">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="54">
<caret line="5" column="0" lean-forward="false" selection-start-line="5" selection-start-column="0" selection-end-line="5" selection-end-column="0" />
<folding />
</state>
</provider>

13
main.go
View File

@ -56,13 +56,9 @@ func main() {
//&encodings.CopyRectEncoding{},
//coRRE := encodings.CoRREEncoding{},
//hextile := encodings.HextileEncoding{},
&encodings.PseudoEncoding{int32(common.EncJPEGQualityLevelPseudo9)},
&encodings.PseudoEncoding{int32(common.EncJPEGQualityLevelPseudo8)},
}
// file, _ := os.OpenFile("stam.bin", os.O_CREATE|os.O_RDWR, 0755)
// defer file.Close()
//tight.SetOutput(file)
clientConn.SetEncodings(encs)
clientConn.FramebufferUpdateRequest(false, 0, 0, 1280, 800)
@ -94,16 +90,9 @@ func main() {
clientConn.Close()
}()
//go func() {
// for msg := range vncSrvMessagesChan {
// logger.Debugf("message type: %d, content: %v\n", msg.Type(), msg)
// }
for {
time.Sleep(time.Minute)
}
//}()
//clientConn.Close()
}
func getNowMillisec() int {
return int(time.Now().UnixNano() / int64(time.Millisecond))

98
player/cmd/main.go Normal file
View File

@ -0,0 +1,98 @@
package main
import (
"flag"
"fmt"
"os"
"vncproxy/common"
"vncproxy/encodings"
"vncproxy/logger"
"vncproxy/player"
"vncproxy/server"
)
func main() {
wsPort := flag.String("wsPort", "", "websocket port for player to listen to client connections")
tcpPort := flag.String("tcpPort", "", "tcp port for player to listen to client connections")
fbsFile := flag.String("fbsFile", "", "fbs file to serve to all connecting clients")
flag.Parse()
fmt.Println("**************************************************************************")
fmt.Println("*** This is a toy server that replays a single FBS file to all clients ***")
fmt.Println("**************************************************************************")
if *fbsFile == "" {
logger.Error("there is no FBS file to replay to incoming clients")
flag.Usage()
os.Exit(1)
}
if *tcpPort == "" && *wsPort == "" {
logger.Error("no listening port defined")
flag.Usage()
os.Exit(1)
}
//chServer := make(chan common.ClientMessage)
//chClient := make(chan common.ServerMessage)
encs := []common.IEncoding{
&encodings.RawEncoding{},
&encodings.TightEncoding{},
&encodings.EncCursorPseudo{},
&encodings.TightPngEncoding{},
&encodings.RREEncoding{},
&encodings.ZLibEncoding{},
&encodings.ZRLEEncoding{},
&encodings.CopyRectEncoding{},
&encodings.CoRREEncoding{},
&encodings.HextileEncoding{},
}
cfg := &server.ServerConfig{
//SecurityHandlers: []SecurityHandler{&ServerAuthNone{}, &ServerAuthVNC{}},
SecurityHandlers: []server.SecurityHandler{&server.ServerAuthNone{}},
Encodings: encs,
PixelFormat: common.NewPixelFormat(32),
ClientMessages: server.DefaultClientMessages,
DesktopName: []byte("workDesk"),
Height: uint16(768),
Width: uint16(1024),
}
cfg.NewConnHandler = func(cfg *server.ServerConfig, conn *server.ServerConn) error {
//fbs, err := loadFbsFile("/Users/amitbet/Dropbox/recording.rbs", conn)
//fbs, err := loadFbsFile("/Users/amitbet/vncRec/recording.rbs", conn)
fbs, err := player.ConnectFbsFile(*fbsFile, conn)
if err != nil {
logger.Error("TestServer.NewConnHandler: Error in loading FBS: ", err)
return err
}
conn.Listeners.AddListener(player.NewFBSPlayListener(conn, fbs))
return nil
}
if *tcpPort == "" && *wsPort == "" {
logger.Error("no listening port defined")
flag.Usage()
os.Exit(1)
}
url := "http://localhost:" + *wsPort + "/"
if *tcpPort != "" && *wsPort != "" {
logger.Infof("running two listeners: tcp port: %s, ws url: %s", *tcpPort, url)
go server.WsServe(url, cfg)
server.TcpServe(":"+*tcpPort, cfg)
}
if *tcpPort == "" && *wsPort != "" {
logger.Infof("running ws listener url: %s", url)
server.WsServe(url, cfg)
}
logger.Infof("running tcp listener on port: %s", *tcpPort)
server.TcpServe(":"+*tcpPort, cfg)
}

View File

@ -19,6 +19,26 @@ type FBSPlayListener struct {
startTime int
}
func ConnectFbsFile(filename string, conn *server.ServerConn) (*FbsReader, error) {
fbs, err := NewFbsReader(filename)
if err != nil {
logger.Error("failed to open fbs reader:", err)
return nil, err
}
//NewFbsReader("/Users/amitbet/vncRec/recording.rbs")
initMsg, err := fbs.ReadStartSession()
if err != nil {
logger.Error("failed to open read fbs start session:", err)
return nil, err
}
conn.SetPixelFormat(&initMsg.PixelFormat)
conn.SetHeight(initMsg.FBHeight)
conn.SetWidth(initMsg.FBWidth)
conn.SetDesktopName(string(initMsg.NameText))
return fbs, nil
}
func NewFBSPlayListener(conn *server.ServerConn, r *FbsReader) *FBSPlayListener {
h := &FBSPlayListener{Conn: conn, Fbs: r}
cm := client.MsgBell(0)

View File

@ -9,26 +9,6 @@ import (
"vncproxy/server"
)
func connectFbsFile(filename string, conn *server.ServerConn) (*FbsReader, error) {
fbs, err := NewFbsReader(filename)
if err != nil {
logger.Error("failed to open fbs reader:", err)
return nil, err
}
//NewFbsReader("/Users/amitbet/vncRec/recording.rbs")
initMsg, err := fbs.ReadStartSession()
if err != nil {
logger.Error("failed to open read fbs start session:", err)
return nil, err
}
conn.SetPixelFormat(&initMsg.PixelFormat)
conn.SetHeight(initMsg.FBHeight)
conn.SetWidth(initMsg.FBWidth)
conn.SetDesktopName(string(initMsg.NameText))
return fbs, nil
}
func TestServer(t *testing.T) {
//chServer := make(chan common.ClientMessage)
@ -61,7 +41,7 @@ func TestServer(t *testing.T) {
cfg.NewConnHandler = func(cfg *server.ServerConfig, conn *server.ServerConn) error {
//fbs, err := loadFbsFile("/Users/amitbet/Dropbox/recording.rbs", conn)
//fbs, err := loadFbsFile("/Users/amitbet/vncRec/recording.rbs", conn)
fbs, err := connectFbsFile("/Users/amitbet/vncRec/recording1500554806.rbs", conn)
fbs, err := ConnectFbsFile("/Users/amitbet/vncRec/recording1500554806.rbs", conn)
if err != nil {
logger.Error("TestServer.NewConnHandler: Error in loading FBS: ", err)

57
proxy/cmd/main.go Normal file
View File

@ -0,0 +1,57 @@
package main
import "vncproxy/proxy"
import "flag"
import "fmt"
import "vncproxy/logger"
import "os"
func main() {
fmt.Println("running!")
//create default session if required
var tcpPort = flag.String("tcpPort", "", "tcp port")
var wsPort = flag.String("wsPort", "", "websocket port")
var vncPass = flag.String("vncPass", "", "password on incoming vnc connections to the proxy, defaults to no password")
var recordDir = flag.String("recDir", "", "path to save FBS recordings WILL NOT RECORD if not defined.")
var targetVncPort = flag.String("targPort", "", "target vnc server port")
var targetVncPass = flag.String("targPass", "", "target vnc password")
flag.Parse()
if *tcpPort == "" && *wsPort == "" {
logger.Error("no listening port defined")
flag.Usage()
os.Exit(1)
}
if *targetVncPort == "" {
logger.Error("no target vnc server port defined")
flag.Usage()
os.Exit(1)
}
if *vncPass == "" {
logger.Warn("proxy will have no password")
}
if *recordDir == "" {
logger.Warn("FBS recording is turned off")
}
proxy := &proxy.VncProxy{
WsListeningUrl: "http://localhost:" + string(*wsPort) + "/", // empty = not listening on ws
RecordingDir: *recordDir, //"/Users/amitbet/vncRec", // empty = no recording
TcpListeningUrl: ":" + string(*tcpPort),
ProxyVncPassword: *vncPass, //empty = no auth
SingleSession: &proxy.VncSession{
TargetHostname: "localhost",
TargetPort: *targetVncPort,
TargetPassword: *targetVncPass, //"vncPass",
ID: "dummySession",
//Status: SessionStatusActive,
//Type: SessionTypeRecordingProxy,
}, // to be used when not using sessions
UsingSessions: false, //false = single session - defined in the var above
}
proxy.StartListening()
}

View File

@ -1,7 +1,6 @@
package proxy
import (
"log"
"net"
"path"
"strconv"
@ -15,17 +14,16 @@ import (
)
type VncProxy struct {
tcpListeningUrl string // empty = not listening on tcp
wsListeningUrl string // empty = not listening on ws
recordingDir string // empty = no recording
proxyPassword string // empty = no auth
targetServersPassword string //empty = no auth
SingleSession *VncSession // to be used when not using sessions
UsingSessions bool //false = single session - defined in the var above
sessionManager *SessionManager
TcpListeningUrl string // empty = not listening on tcp
WsListeningUrl string // empty = not listening on ws
RecordingDir string // empty = no recording
ProxyVncPassword string //empty = no auth
SingleSession *VncSession // to be used when not using sessions
UsingSessions bool //false = single session - defined in the var above
sessionManager *SessionManager
}
func (vp *VncProxy) createClientConnection(targetServerUrl string) (*client.ClientConn, error) {
func (vp *VncProxy) createClientConnection(targetServerUrl string, vncPass string) (*client.ClientConn, error) {
nc, err := net.Dial("tcp", targetServerUrl)
if err != nil {
@ -34,7 +32,7 @@ func (vp *VncProxy) createClientConnection(targetServerUrl string) (*client.Clie
}
var noauth client.ClientAuthNone
authArr := []client.ClientAuth{&client.PasswordAuth{Password: vp.targetServersPassword}, &noauth}
authArr := []client.ClientAuth{&client.PasswordAuth{Password: vncPass}, &noauth}
//vncSrvMessagesChan := make(chan common.ServerMessage)
@ -68,7 +66,7 @@ func (vp *VncProxy) getTargetServerFromSession(sessionId string) (*VncSession, e
func (vp *VncProxy) newServerConnHandler(cfg *server.ServerConfig, sconn *server.ServerConn) error {
recFile := "recording" + strconv.FormatInt(time.Now().Unix(), 10) + ".rbs"
recPath := path.Join(vp.recordingDir, recFile)
recPath := path.Join(vp.RecordingDir, recFile)
rec, err := listeners.NewRecorder(recPath)
if err != nil {
logger.Errorf("Proxy.newServerConnHandler can't open recorder save path: %s", recPath)
@ -88,7 +86,7 @@ func (vp *VncProxy) newServerConnHandler(cfg *server.ServerConfig, sconn *server
//clientSplitter := &common.MultiListener{}
cconn, err := vp.createClientConnection(session.TargetHostname + ":" + session.TargetPort)
cconn, err := vp.createClientConnection(session.TargetHostname+":"+session.TargetPort, session.TargetPassword)
if err != nil {
logger.Errorf("Proxy.newServerConnHandler error creating connection: %s", err)
return err
@ -142,12 +140,12 @@ func (vp *VncProxy) newServerConnHandler(cfg *server.ServerConfig, sconn *server
func (vp *VncProxy) StartListening() {
//chServer := make(chan common.ClientMessage)
chClient := make(chan common.ServerMessage)
//chClient := make(chan common.ServerMessage)
secHandlers := []server.SecurityHandler{&server.ServerAuthNone{}}
if vp.proxyPassword != "" {
secHandlers = []server.SecurityHandler{&server.ServerAuthVNC{vp.proxyPassword}}
if vp.ProxyVncPassword != "" {
secHandlers = []server.SecurityHandler{&server.ServerAuthVNC{vp.ProxyVncPassword}}
}
cfg := &server.ServerConfig{
SecurityHandlers: secHandlers,
@ -165,18 +163,19 @@ func (vp *VncProxy) StartListening() {
// },
}
if vp.tcpListeningUrl != "" {
go server.TcpServe(vp.tcpListeningUrl, cfg)
if vp.TcpListeningUrl != "" && vp.WsListeningUrl != "" {
logger.Infof("running two listeners: tcp port: %s, ws url: %s", vp.TcpListeningUrl, vp.WsListeningUrl)
go server.WsServe(vp.WsListeningUrl, cfg)
server.TcpServe(":"+vp.TcpListeningUrl, cfg)
}
if vp.wsListeningUrl != "" {
go server.WsServe(vp.wsListeningUrl, cfg)
if vp.WsListeningUrl != "" {
logger.Infof("running ws listener url: %s", vp.WsListeningUrl)
server.WsServe(vp.WsListeningUrl, cfg)
}
// Process messages coming in on the ClientMessage channel.
for {
msg := <-chClient
switch msg.Type() {
default:
log.Printf("Received message type:%v msg:%v\n", msg.Type(), msg)
}
if vp.TcpListeningUrl != "" {
logger.Infof("running tcp listener on port: %s", vp.TcpListeningUrl)
server.TcpServe(":"+vp.TcpListeningUrl, cfg)
}
}

View File

@ -6,15 +6,15 @@ func TestProxy(t *testing.T) {
//create default session if required
proxy := &VncProxy{
wsListeningUrl: "http://localhost:7777/", // empty = not listening on ws
recordingDir: "/Users/amitbet/vncRec", // empty = no recording
tcpListeningUrl: ":5904",
WsListeningUrl: "http://localhost:7777/", // empty = not listening on ws
RecordingDir: "/Users/amitbet/vncRec", // empty = no recording
TcpListeningUrl: ":5904",
//recordingDir: "C:\\vncRec", // empty = no recording
targetServersPassword: "Ch_#!T@8", //empty = no auth
ProxyVncPassword: "1234", //empty = no auth
SingleSession: &VncSession{
TargetHostname: "localhost",
TargetPort: "5903",
TargetPassword: "vncPass",
TargetPassword: "Ch_#!T@8",
ID: "dummySession",
Status: SessionStatusActive,
Type: SessionTypeRecordingProxy,