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

X11 Server #152

Open
RossComputerGuy opened this issue Sep 27, 2017 · 13 comments
Open

X11 Server #152

RossComputerGuy opened this issue Sep 27, 2017 · 13 comments

Comments

@RossComputerGuy
Copy link
Contributor

I'm trying to build my own x11 server and I've built upon the existing code, but I'm stuck at pack_stream.pack("CxSSSa",[1,11,0,hello.length/4,hello]); and I don't know what hello is suppose to be set to.

@sidorares
Copy link
Owner

What type of server you building? I can't remember how complete server side of this library is, and it does not attempt to implement any functionality/semantics at all, just protocol. Intended use case is various types of proxy servers talking to "Real" x11 server

@sidorares
Copy link
Owner

looks like you are talking about this line:

stream.pack('CxSSSa', [1, 11, 0, hello.length/4, hello]);

( wow, there is hard coded fs.readFile there )

I'm pretty sure this is server side of what happens here:

function readServerHello(bl, cb)

Have a look at what readServerHello does on client, from there you can figure out how to serialize that on server

@RossComputerGuy
Copy link
Contributor Author

I've not been able to figure it out, I've spent the last few hours looking and couldn't figure it out.

@sidorares
Copy link
Owner

I might be able to help later today but no promices

@RossComputerGuy
Copy link
Contributor Author

Here is a chunk of my working code

this.pack_stream.pack("C",[1]);
		this.pack_stream.flush();
		
		this.pack_stream.pack("xSSSLLLLSSCCCCCCCCxxxxp",[
			this.protocolMajor, // major
			this.protocolMinor, // minor
			(32+this.server.formats.getByteLength()+stringPad(this.vendor)+this.server.screens.getByteLength())/4, // xlen
			0, // release
			this.resource_id_base, // resource_base
			this.resource_id_mask, // resource_mask
			255, // motion_buffer_size
			this.vendor.length, // vlen
			0xffff, // max_request_length
			this.server.screens.arr.length, // screen_num
			this.server.formats.arr.length, // format_num
			0, // image_byte_order
			0, // bitmap_bit_order
			32, // bitmap_scanline_unit
			32, // bitmap_scanline_pad
			8, // min_keycode
			255, // max_keycode
			
			this.vendor // vendor
		]);
		this.pack_stream.flush();
		for(var format of this.server.formats.arr) {
			this.pack_stream = format.pack(this.pack_stream);
			this.pack_stream.flush();
		}
		for(var screen of this.server.screens.arr) {
			this.pack_stream = screen.pack(this.pack_stream);
			this.pack_stream.flush();
		}

@RossComputerGuy
Copy link
Contributor Author

X11 Server

@sidorares
Copy link
Owner

not much there yet @SpaceboyRoss01 :)
What are you plans re server implementation?

@RossComputerGuy
Copy link
Contributor Author

RossComputerGuy commented Nov 14, 2018 via email

@sidorares
Copy link
Owner

Would it actually implement some x server functionality or act as a proxy to "real" server?

@RossComputerGuy
Copy link
Contributor Author

RossComputerGuy commented Nov 14, 2018 via email

@sidorares
Copy link
Owner

sidorares commented Nov 14, 2018

What would it use for display? Offscreen pixmap / browser / etc?

these two use browser:

https://github.com/GothAck/javascript-x-server
https://github.com/ttaubert/x-server-js

@RossComputerGuy
Copy link
Contributor Author

RossComputerGuy commented Nov 14, 2018 via email

@RossComputerGuy
Copy link
Contributor Author

I might need some help with writing the code to get it to work.

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

No branches or pull requests

2 participants